Commit Graph

11523 Commits

Author SHA1 Message Date
Georgy Bronnikov 58a9c0c996 JVM_IR: remove descriptor usage from IrTypeMapper 2020-06-13 12:44:59 +03:00
Igor Chevdar 8b37a094fe Added a test on possible name clash for SAM wrappers 2020-06-11 23:00:36 +05:00
Denis Zharkov 293f78efe8 FIR: Correct capturing for type-alias bases arguments
NB: The test data change at testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.fir.kt
is correct: see the relevant non-fir test, the call shouldn't be applicable

^KT-39008 Fixed
2020-06-11 11:31:38 +03:00
Denis Zharkov 72b09ff323 FIR: Rename FirSuperTypeScope and reuse it for type parameter type
It would allow ConeKotlinType.scope return FirTypeScope
and thus pulling down org.jetbrains.kotlin.fir.scopes.FirScope#processOverriddenFunctions
(See the following commits)
2020-06-11 11:31:31 +03:00
Denis Zharkov 38922a84f1 FIR: Do not create synthetic properties for non-Java accessors
^KT-35495 Fixed
2020-06-11 11:01:43 +03:00
Jinseong Jeon ab2a2b3a87 FIR2IR: eager conversion of annotations in Library class and members 2020-06-11 10:57:51 +03:00
Mikhail Zarechenskiy 3921a0ed70 Add test for obsolete issue
#KT-17341 Obsolete
 #KT-32958 Obsolete
2020-06-10 16:00:23 +03:00
Mads Ager dc34d355bc [JVM_IR] Generate line numbers and nops for init blocks.
This seems to be what JVM does and it allows you to set a
breakpoint on the init line.
2020-06-10 08:05:52 +02:00
Ilmir Usmanov 85e2392fef Fix merging two reference values
In this case, make the result of value type Object instead of unknown.
2020-06-09 20:52:29 +02:00
Ilmir Usmanov 5567033b33 Revert "Revert "Completely rewrite reifiedIntTypeAnalysis, making it more streamline""
This reverts commit 822c14814b.
2020-06-09 20:52:24 +02:00
Alexander Udalov e801fad4d4 Minor, unmute test on fun interface inheritance for FIR 2020-06-09 20:00:37 +02:00
Mikhail Zarechenskiy 93e9d3e57d Delay check for possibly deferred return type for reference candidate
This issue appeared after recently added new overload for flatMapTo.
 Before that, we picked candidate returning List<T> and completed
 inference, now we also check one more flatMapTo, which is here is
 incorrect and as a result we go into outer scope. Outer scope contains
 one property with deferred type, which introduced error about
 "typechecker has run into recursive problem" even it isn't applicable
 by receiver.

 So, the fix is to check receiver first and only then check return
 type of a candidate.

 #KT-39470 Fixed
2020-06-09 17:36:58 +03:00
Alexander Udalov 6adad1055b JVM IR: generate delegates to DefaultImpls for fun interfaces 2020-06-09 11:49:45 +02:00
Alexander Udalov fc1217ba07 Generate delegates to DefaultImpls in fun interface wrappers
#KT-37436 Fixed
2020-06-09 11:44:31 +02:00
Alexander Udalov 77e479fda8 JVM IR: generate InnerClasses attribute for nested classes in annotation arguments
#KT-38853
2020-06-09 11:33:27 +02:00
Alexander Udalov 2793187bda Handle IllegalArgumentException in trimMargin intrinsics on JVM
#KT-38537 Fixed
2020-06-09 11:11:06 +02:00
Mikhail Glukhikh 6f0eeecc64 [FIR2IR] Fix generation of type arguments of delegated constructor calls 2020-06-09 11:40:26 +03:00
Mikhail Glukhikh b2c78e490e [FIR2IR] Remove some descriptor-around calls 2020-06-09 11:40:25 +03:00
Ilya Chernikov 69d5635aae [minor] Fix textdata after reapplying commit w\ CompilerMessageLocation 2020-06-09 10:34:38 +02:00
Dmitriy Novozhilov 802272a579 Enable ContractsOnCallsWithImplicitReceiver in 1.4
#KT-28672 Fixed
2020-06-09 11:21:57 +03:00
simon.ogorodnik cd9273028b Profiling and repeat support for JVM CLI Compiler 2020-06-08 20:40:27 +03:00
Mikhail Glukhikh 89e5e10657 [FIR2IR] Drop effectively unused FirMetadataSource.File.descriptors
NB: only FileClassLowering uses this property to check
whether facade is required, and IR-based check is enough in this lowering
2020-06-08 16:19:37 +03:00
Mikhail Glukhikh 6eab6a96cb [FIR2IR] Support type aliases properly 2020-06-08 16:19:37 +03:00
Jinseong Jeon ba1172b3ad FIR2IR: distinguish substitution case when adding external fake overrides 2020-06-08 12:11:34 +03:00
Mikhail Glukhikh 3567880303 [FIR] Consider enum entry nested classes as local 2020-06-08 12:11:33 +03:00
Jinseong Jeon 0d2552b0b6 FIR: record and serialize the modifier "fun" for functional interface 2020-06-08 09:42:32 +03:00
Anton Bannykh bd2a0563ad JS: fix explicit cross-module SAM constructor calls 2020-06-06 13:20:37 +03:00
Ilmir Usmanov f0006f2405 Minor. Add regression test
#KT-39374 Fixed
2020-06-05 21:30:24 +02:00
Jinseong Jeon 89c87f941f FIR: consider the absence of type arguments when constructing GetClassCall type 2020-06-05 17:00:17 +03:00
Mikhail Zarechenskiy a086d9f7df Update forgotten FIR test 2020-06-05 16:30:09 +03:00
Mikhail Zarechenskiy 6c5806f971 Add test for obsolete issue
#KT-38161 Obsolete
2020-06-05 16:30:08 +03:00
Mikhail Zarechenskiy 22b558110d Don't apply Unit-conversion for expressions that return Nothing type 2020-06-05 15:59:31 +03:00
Mikhail Zarechenskiy fb812301b2 Add test to preserve behaviour
It's important to have ambiguity in these cases to introduce overload
 resolution by suspend-modifier without breaking changes in future

 Relates to #KT-23610
2020-06-05 14:07:08 +03:00
Mikhail Zarechenskiy e72401c5f4 Don't allow coercing receivers from signed to unsigned constants 2020-06-05 13:24:22 +03:00
Mikhail Zarechenskiy bfa648972f Introduce call checker for Unit-conversions 2020-06-05 13:24:21 +03:00
Mikhail Zarechenskiy 6b0a803d14 Allow suspend-conversion for callable references as part of adaptation 2020-06-05 13:24:21 +03:00
Mikhail Zarechenskiy 71cbe97688 Introduce Unit-conversions for simple arguments 2020-06-05 13:24:20 +03:00
Mikhail Zarechenskiy a4af833d55 Narrow down the range for compatibility warning to callee expression 2020-06-05 13:24:19 +03:00
Mikhail Zarechenskiy 718f23b34f Compatibility warning for references to companion via name (KT-13934) 2020-06-05 13:24:18 +03:00
Ilmir Usmanov 8cc5f2abfb Forbid val field initialization inside EXACLTY_ONCE lambda
unless the lambda is inline. This way, final field will remain final.
2020-06-04 21:26:48 +02:00
Steven Schäfer 3291cf7a6e JVM IR: Mark lateinit fields as NotNull
This is needed for compatibility with the JVM backend.
2020-06-04 17:52:56 +02:00
Mikhail Glukhikh 6ad37eb7a8 Unmute two more FIR BB tests 2020-06-04 17:26:27 +03:00
Mark Punzalan 802beb49a6 Use TypeSubstitutor to get the substituted underlying type for inline
classes, instead of MemberScope.

The primary motivation was to fix issues around type-mapping for inline
classes in FIR, which uses wrapped descriptors that have empty
MemberScopes.
2020-06-04 17:03:55 +03:00
Mikhail Glukhikh 88b130308d Revert accidental test data change introduced in 0d6e3093 2020-06-04 16:34:40 +03:00
Mikhail Glukhikh 0ce47f2f12 [FIR TEST] Mute 2 BB tests broken by 0d6e3093 2020-06-04 16:34:39 +03:00
Alexander Udalov 5647a935a2 JVM IR: do not generate DefaultImpls delegate for collection fake overrides
In the newly added test, prior to this change, JVM IR was generating
DefaultImpls classes with calls to things like
`kotlin/collections/MutableList$DefaultImpls.spliterator` and other
default methods present in JDK 8+. This obviously didn't make much
sense. Although these weren't explicitly mentioned anywhere in the
bytecode, they caused some validation tools to report errors (e.g.
animalsniffer used in arrow).
2020-06-04 14:27:46 +02:00
Dmitry Petrov de25359a90 Fix stdlib compilation after updated @JvmName check
Previously, extension receiver type was not taken into account when
checking for @JvmName annotation applicability to possibly mangled
functions (such functions, however, were mangled).
This bug was fixed, but, unfortunately, not before such functions were
added to stdlib ('sumOf' family).
2020-06-04 12:16:28 +03:00
Dmitry Petrov 202bbdf8dd Forward compatibility hacks for Result.{success, failure}
Don't mangled functions annotated with @JvmName.
Annotate 'Result.success' and 'Result.failure' with @JvmName and
@Suppress("INAPPLICABLE_JVM_NAME").
NB this would require bootstrap.
2020-06-04 12:16:27 +03:00
Jinseong Jeon 0d6e309372 FIR: construct type with actual type arguments during GetClassCall transformation 2020-06-04 10:13:37 +03:00
Dmitry Petrov a4b9e8fdc6 Minor: mute test in JS_IR 2020-06-03 23:24:16 +03:00