Commit Graph

271 Commits

Author SHA1 Message Date
Alexander Udalov d257285c86 Load Java enums as final classes
In case Java enum has an abstract member, it has the ACC_ABSTRACT flag
set in the bytecode. However, we should still load it with final
modality to be consistent with Kotlin enums which are always considered
final

 #KT-23426 Fixed
2019-04-10 14:39:16 +03:00
Mikhail Glukhikh 568e831651 FIR: make rendering of type parameters similar to original Kotlin 2019-04-10 13:31:02 +03:00
Mikhail Glukhikh 0c334163ab FIR: add class type parameters to constructors & change their rendering 2019-04-10 13:31:01 +03:00
Mikhail Glukhikh 40441a18cc FIR2IR tests: do not try to dump & check external dependencies
(because both wrapped descriptors and FIR-based package descriptors
have no member scopes and aren't able to find class across module deps)
2019-04-09 15:36:18 +03:00
Mikhail Glukhikh e1915ec99e FIR2IR: add bunch file for 181 to avoid compilation problems 2019-04-05 16:18:59 +03:00
Mikhail Glukhikh ee28467a47 Raw FIR: add work-around for deeply nested String interpolations
Controversial (but prevents total kotlin test failing)
Related to KT-29222
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh 881073b1c9 Add basic FIR -> IR converter with a set of text tests
Tests duplicate IrTextTestCaseGenerated
#KT-24065 Fixed
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh d736a7da6b Raw FIR: get rid of array gets, use array sets only for modifications
(a[b] += c etc. cannot be replaced with get/set calls easily)
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh a0c4e2f05f Raw FIR: convert in to contains and !in to contains.not 2019-04-05 16:18:58 +03:00
Mikhail Glukhikh 4482a8f794 Remove FirOperation.RANGE which was effectively unused
Associated KtTokens.RANGE is included into convention call table
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh 007edcb4a4 Raw FIR: generate convention / infix binary expressions with receiver 2019-04-05 16:18:57 +03:00
Mikhail Zarechenskiy ff2ce316e1 [NI] Resolve callable reference eagerly at the end of resolution parts
This way we'll resolve less callable references later as we'll have
 more constraints to clip wrong candidates for callable references
2019-04-05 13:16:58 +03:00
Mikhail Zarechenskiy c3bc6ef2fa [NI] Make callable references more robust to overloads of outer call
#KT-30676 Fixed
2019-04-05 13:16:54 +03:00
Mikhail Zarechenskiy 20a7f387bf [NI] Resolve callable reference eagerly if there is only one candidate
#KT-30737 Fixed
2019-04-05 13:15:57 +03:00
Dmitriy Novozhilov aa96a05469 [NI] Fix initial data flow info for analyzing lambdas
#KT-30734 Fixed
2019-04-05 12:52:29 +03:00
Mikhail Glukhikh 141e8d553e FIR body resolve: support variable assignments 2019-04-04 10:31:15 +03:00
Mikhail Glukhikh c56b471b71 FIR body resolve: handle constant types more precisely 2019-04-04 10:31:13 +03:00
Mikhail Glukhikh cc2a5cfc06 FIR body resolve: calculate type even for resolved references 2019-04-04 10:31:12 +03:00
Mikhail Glukhikh d7f0392f90 FIR body resolve: fix value parameter expected type 2019-04-04 10:31:11 +03:00
Mikhail Glukhikh 8a6c9a6aec FIR deserializer: read nullability & add constructors 2019-04-04 10:31:09 +03:00
Mikhail Glukhikh 6e9d78d431 FIR structure: make implicit built-in types resolved 2019-04-04 10:31:08 +03:00
Mikhail Glukhikh bf0190d96c FIR structure: reuse StandardClassIds in implicit built-in typeRef 2019-04-04 10:31:07 +03:00
Mikhail Glukhikh b3cf3c6579 FIR structure: include calleeReference into FirDelegatedConstructorCall 2019-04-04 10:31:05 +03:00
Mikhail Glukhikh 63d3100122 FIR structure: FirClassLikeDeclaration is now FirStatement
Done to support (in theory) local type aliases
2019-04-04 10:31:04 +03:00
Mikhail Glukhikh 4213a4c7e2 FIR Java: reuse StandardClassIds 2019-04-04 10:31:02 +03:00
Mikhail Glukhikh a0fa9e6b48 Raw FIR: make component call a function call, its argument -> receiver 2019-04-04 10:31:01 +03:00
Mikhail Glukhikh 30697787a0 Raw FIR: set "implicit boolean" result type for some operator calls 2019-04-04 10:31:00 +03:00
Mikhail Glukhikh eb1aaad41b Raw FIR: generate Unit at the end of empty lambda 2019-04-04 10:30:52 +03:00
Mikhail Glukhikh eb86c9e540 FIR: get rid of ANDAND / OROR by replacing with when 2019-04-04 10:30:49 +03:00
Mikhail Glukhikh 395651a21e Raw FIR: swap branches in when for elvis and bang-bang 2019-04-04 10:30:48 +03:00
Mikhail Glukhikh f77ba2dd3e Raw FIR: make object/sealed/enum constructor visibility private 2019-04-04 10:30:47 +03:00
Mikhail Glukhikh 057156f323 Raw FIR builder: cleanup code 2019-04-04 10:30:45 +03:00
Mikhail Glukhikh 33729aaf9b Raw FIR: add Any/Enum/Annotation to supertypes iff no supertypes exists 2019-04-04 10:30:44 +03:00
Mikhail Glukhikh 7dd89a48f0 Raw FIR: introduce FirConstructor.isPrimary 2019-04-04 10:30:43 +03:00
Mikhail Glukhikh 61c2e4e590 Raw FIR: handle local visibility for functions & classes 2019-04-04 10:30:41 +03:00
Mikhail Glukhikh 4187ea1f86 Raw FIR: add initializers to primary constructor properties 2019-04-04 10:30:40 +03:00
Mikhail Zarechenskiy c458393e2f [NI] Do not avoid trivial constraints if they aren't from upper bounds
Since we skipped trivial constraint with `Any?` from parameter type of
 function `equals`, the compiler thought that there is no proper
 constraints (upper bounds do not matter here) and marked resolved
 call as a failed one, then diagnostic about missing equals was added

 Also, tune `TrivialConstraintTypeInferenceOracle` for `Any?`-like
 constraints

 #KT-30724 Fixed
2019-04-02 12:21:14 +03:00
Simon Ogorodnik 3998e842f1 Abstract NewInference & related from KotlinType
Cleanup TypeConstructors & KotlinTypes in VariableFixationFinder
Cleanup TypeConstructors & KotlinTypes in TypeVariableDirectionCalculator
Cleanup KotlinTypes in TypeCheckerContext for ConstraintSystem
Cleanup KotlinTypes in NewCommonSuperTypeCalculator
Cleanup KotlinTypes in TypeApproximator
Cleanup type substitution
Cleanup NewTypeVariable
Cleanup StubType
Cleanup TypeCheckerContext creation, extract common supertype context
Provide TypeSystemInferenceExtensionContext via dependency injection
2019-04-01 22:08:04 +03:00
Denis Zharkov 66293f4024 FIR: Add @Ignore for FirResolveTestTotalKotlin
Otherwise, it leads to OOM while running on teamcity
Of course, FIR parts might be optimized there but we'll do it later
2019-03-28 17:37:36 +03:00
Denis Zharkov 3164197b88 FIR: Fix compilation for bunch file AbstractFirTypeEnhancementTest.kt.181 2019-03-28 17:32:12 +03:00
Denis Zharkov b1474b11f2 FIR: Fix FirSupertypeResolverTransformer for case of redeclarations
When transforming a specific class look for the exact match
Otherwise the last redeclaration will be overwritten by the first one
2019-03-28 11:19:52 +03:00
Simon Ogorodnik a23e4bfdf1 Fix superType resolver 2019-03-28 11:19:52 +03:00
Simon Ogorodnik 49a0b29129 Store containers per symbol, not per callable id 2019-03-28 11:19:52 +03:00
Denis Zharkov 48f0790785 FIR: Fix bunch files for 181 2019-03-28 11:14:55 +03:00
Denis Zharkov 7b97c2a42a FIR: Weaken requirements for all symbols to have correct FIR
Currently, some cases like library type parameters are not supported properly
2019-03-27 17:17:59 +03:00
Denis Zharkov 825218b479 Replace FirSymbolProvider::getCallableSymbols with two methods
Requesting content of classes seems to be reasonable and at the same time
more easy to implement in Composite providers: they should find
just the first class' result instead of flatmapping all of them
2019-03-27 17:17:59 +03:00
Denis Zharkov 1426341e9f FIR: Support loading deserialized declarations from JVM class files 2019-03-27 17:17:59 +03:00
Denis Zharkov 0f9d54c4dc FIR: Support deserialization of nested classes 2019-03-27 17:17:59 +03:00
Denis Zharkov bb1acdbe95 Minor. Extract classes deserialization from BuiltInsPackageFragment 2019-03-27 17:17:59 +03:00
Denis Zharkov b3e5e059bb Minor. Extract FirDeserializationContext factories 2019-03-27 17:17:59 +03:00