Commit Graph

52981 Commits

Author SHA1 Message Date
Alexander Udalov 87c6b723f0 Add JvmBuiltIns.Kind instead of boolean flags in constructor 2019-03-22 14:59:03 +01:00
Alexander Udalov c32d7ef116 Do not create additional module for built-ins in reflection 2019-03-22 14:59:03 +01:00
Alexander Udalov ed86757817 Rework how built-in types are loaded in compiler for JVM
In TopDownAnalyzerFacadeForJVM, we now always use the "load built-ins
from module dependencies" behavior that was previously only enabled with
the dedicated CLI argument -Xload-builtins-from-dependencies. However,
sometimes we compile code without kotlin-stdlib in the classpath, and we
don't want everything to crash because some standard type like
kotlin.Unit hasn't been found.

To mitigate this, we add another module at the end of the dependencies
list, namely a "fallback built-ins" module. This module loads all
built-in declarations from the compiler's class loader, as was done by
default previously. This prevents the compiler from crashing if any
built-in declaration is not found, but compiling the code against
built-ins found in the compiler is still discouraged, so we report an
error if anything is resolved to a declaration from this module, via a
new checker MissingBuiltInDeclarationChecker.

Also introduce a new CLI argument -Xsuppress-missing-builtins-error
specifically to suppress this error and to allow compiling code against
compiler's own built-ins.

 #KT-19227 Fixed
 #KT-28198 Fixed
2019-03-22 14:59:03 +01:00
Alexander Udalov 8ce7742e7c Inject DeserializationConfiguration into JvmBuiltInsPackageFragmentProvider 2019-03-22 14:59:03 +01:00
Alexander Udalov 05700b8c43 Use JvmResolveUtil.createContainer in AbstractDescriptorRendererTest 2019-03-22 14:59:03 +01:00
Alexander Gorshenev a3b1d3ff62 Allow forward declarations bring additional IR dependencies
for modules present in metadata.
2019-03-22 16:47:08 +03:00
Alexander Gorshenev 674580fdef File annotation deserialization is triggered by the first file use 2019-03-22 16:47:08 +03:00
Alexander Gorshenev 215da10687 A little refactoring of deserializer in preparation for the next commit. 2019-03-22 16:47:08 +03:00
Alexander Gorshenev 3bc4616a17 Eliminated global state in IR deserializer. 2019-03-22 16:47:08 +03:00
Ilya Matveev 8f9189d61e Update Kotlin/Native: 1.2-eap-8879 2019-03-22 20:27:18 +07:00
Simon Ogorodnik b617c40051 FIR: Update testData for fir multi-module test (rendering+body resolve) 2019-03-22 16:25:24 +03:00
Simon Ogorodnik 85a096029c FIR: Do not fail on not calculated type 2019-03-22 16:25:24 +03:00
Simon Ogorodnik 70e324277e FIR: Stub for super references 2019-03-22 16:25:23 +03:00
Mikhail Glukhikh 9b4fe2f991 FIR: Fix part of problems with smoke tests 2019-03-22 16:25:22 +03:00
Simon Ogorodnik 3e7e9269ab FIR: Fix 2^n transform complexity in blocks/whens 2019-03-22 16:25:22 +03:00
Simon Ogorodnik 6799eeb084 FIR: Add CallKind 2019-03-22 16:25:21 +03:00
Simon Ogorodnik a562f3db3c FIR: Re-implement call resolver with proper architecture 2019-03-22 16:25:21 +03:00
Simon Ogorodnik 33b44870d6 FIR: Add test for constructor 2019-03-22 16:25:20 +03:00
Simon Ogorodnik 5aa783a961 FIR: Fix visitors/transformers and testData 2019-03-22 16:25:19 +03:00
Simon Ogorodnik 2341692296 FIR: Change transform order in calls/variables to more appropriate 2019-03-22 16:25:19 +03:00
Simon Ogorodnik 071f324738 FIR: Prevent failing on implicit typed local declarations 2019-03-22 16:25:18 +03:00
Simon Ogorodnik 46e432df54 FIR: Prevent failing on constructor substitution 2019-03-22 16:25:18 +03:00
Simon Ogorodnik cd7a96e91b FIR: Proper self-type for constructor return type 2019-03-22 16:25:17 +03:00
Simon Ogorodnik 6c7be3c547 FIR: Improve diagnostic in fir unsafe 2019-03-22 16:25:16 +03:00
Simon Ogorodnik fedde668b3 FIR: Support captureFromArguments for ConeTypes 2019-03-22 16:25:16 +03:00
Simon Ogorodnik 6efb22cd45 FIR: Support typing of type operators 2019-03-22 16:25:15 +03:00
Simon Ogorodnik 79018abee2 FIR: Optimize name gathering in call resolver 2019-03-22 16:25:15 +03:00
Simon Ogorodnik b574693916 FIR: Introduce function to render fir element with it's type 2019-03-22 16:25:14 +03:00
Simon Ogorodnik 24041828a9 FIR: Improve rendering for type operators 2019-03-22 16:25:14 +03:00
Simon Ogorodnik 27687602f8 FIR: Add functions to change nullability/arguments of ConeTypes 2019-03-22 16:25:13 +03:00
Simon Ogorodnik 2118f6008a Extract TypeArgumentListMarker.all 2019-03-22 16:25:12 +03:00
Simon Ogorodnik d9c40c24ed FIR: Allow rendering ConeTypes 2019-03-22 16:25:12 +03:00
Simon Ogorodnik 818701b8df FIR: Implement cycle avoidance in implicit type resolution 2019-03-22 16:25:11 +03:00
Simon Ogorodnik 334c42e8ab FIR: Implement deep implicit types resolution 2019-03-22 16:25:11 +03:00
Simon Ogorodnik 70be1c1024 FIR: Update testData, now it resolves due to call resolver 2019-03-22 16:25:10 +03:00
Simon Ogorodnik 498fb94c37 FIR: Make FIR rendering more kotlin-styled 2019-03-22 16:25:10 +03:00
Simon Ogorodnik 9cc6e44158 FIR: Fix value-parameters redeclare in destructuring 2019-03-22 16:25:09 +03:00
Simon Ogorodnik 9a642ef2e5 FIR: Add test for three receivers 2019-03-22 16:25:08 +03:00
Simon Ogorodnik 43315fd61d FIR: Preparation for resolve to classifiers 2019-03-22 16:25:08 +03:00
Simon Ogorodnik 307b8a1d4c FIR: Support top-level constructors 2019-03-22 16:25:07 +03:00
Simon Ogorodnik d817f719a4 FIR: Cleanup failures in body resolve 2019-03-22 16:25:07 +03:00
Simon Ogorodnik 3867b255f2 FIR: Support this resolve 2019-03-22 16:25:06 +03:00
Simon Ogorodnik 9dc6d93070 FIR: Resolve local callables 2019-03-22 16:25:06 +03:00
Simon Ogorodnik 61eb19fbbf FIR: Make possible to return variable symbols from scope 2019-03-22 16:25:05 +03:00
Simon Ogorodnik 02079bbeb5 FIR: Update fir hierarchy, decouple member declaration from callable 2019-03-22 16:25:04 +03:00
Simon Ogorodnik 7b6f4d8ba4 FIR: Implement implicit invoke desugaring in call resolver 2019-03-22 16:25:04 +03:00
Simon Ogorodnik 3be1d0f946 FIR: Add tests for invoke 2019-03-22 16:25:03 +03:00
Simon Ogorodnik c58c1a6c4e FIR: Add operator test 2019-03-22 16:25:03 +03:00
Simon Ogorodnik 3ac495a45d FIR: Implement basic function call resolve 2019-03-22 16:25:02 +03:00
Simon Ogorodnik 099f98f817 FIR: Expression typing and simple call resolver 2019-03-22 16:25:02 +03:00