Commit Graph

5735 Commits

Author SHA1 Message Date
Denis Zharkov fc5217f7fc Fix signature clash problems caused by special built-ins
Do not treat members with already changed signature as a reason
to create a hidden copy

See tests for clarification:
- There are `charAt` method in B that has different name in Kotlin - `get`,
  i.e. relevant descriptor has initialSignatureDescriptor != null
- When collecting methods from supertypes, `charAt` from A is also get
  transformed to `get`
- So it has effectively the same signature as B.get (already declared)
- If by an accident B.get had been declared with Kotlin signature
  we would have add A.charAt (after transformation) with special flag:
  HiddenToOvercomeSignatureClash (hides it from resolution)
- But here B.charAt was artificially changed to `get`, so no signature clash
  actually happened

 #KT-13730 Fixed
2016-09-09 16:33:32 +03:00
Simon Ogorodnik 2b63bcaa19 Correct diagnostics and quick-fix for T::class with non-reified type parameter #KT-9590 fixed 2016-09-09 16:14:11 +03:00
Alexey Andreev b91ed1e02a KT-13544: support typealiases in JS backend 2016-09-09 14:38:11 +03:00
Alexey Andreev 16af7d667f KT-12868: if a property initializer is a complex expression that emits additional statements, emit these statements directly before assignment to the property, not at the beginning of constructor 2016-09-09 13:54:03 +03:00
Denis Zharkov 44f5df00fe Do not return nested/local classes as a part of package fragment
#KT-13757 Fixed
2016-09-09 10:27:35 +03:00
Denis Zharkov 257417bc4a Minor. Lower type aliase declarations priority
There are several reasons for doing this:
- See org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedMemberScope.computeDescriptors,
  classifiers are being deserialized in the last turn, so it's necessary to preserve consistent order
- Their priority should be close to classes
2016-09-09 10:27:35 +03:00
Michael Bogdanov 8d2ffb2dab Fix wrong "InlineProperties are unsupported at this language level" error on inline functions when inline properties are disabled 2016-09-07 17:39:09 +03:00
Mikhail Zarechenskiy 3ad451e33e Partly support generics and nullable types as parameters for script templates 2016-09-07 17:24:19 +03:00
Michael Bogdanov 7230965e62 Support for property reference inlining 2016-09-07 12:01:49 +03:00
Michael Bogdanov a12d7b6019 Check lambda inlining in package part files in test framework 2016-09-07 12:01:47 +03:00
Dmitry Petrov f2b8569b4b KT-13735 NoSuchMethodError for generic typealias acces
Use underlying constructor descriptor for type alias constructor code generation.
2016-09-07 09:46:00 +03:00
Alexander Udalov cb209074d3 Minor, add regression test on incomplete code with callable reference
#KT-13685 Fixed

(cherry picked from commit c8b30d3310c990193414d7f82bedd50189e0109c)
2016-09-05 13:13:57 +03:00
Dmitry Petrov e0cdad30e4 KT-13181 Unresolved reference when referencing a type alias from a different module
Add corresponding resolution code.
2016-09-02 10:18:23 +03:00
Dmitry Petrov 6428a7655d KT-13422 Type alias for Java exception class can be used as an object in 'throw' expression
Report NO_COMPANION_OBJECT for type aliases.
2016-09-02 10:18:22 +03:00
Stanislav Erokhin 9fa6fb213b Potential fix for some random errors about "cannot choose between equals invoke functions". 2016-09-01 18:01:56 +03:00
Stanislav Erokhin bebc75c8ef Set reference target and report custom error instead unresolved reference for cases: interface, generic parameter, object + invoke, class without companion.
#KT-2787 Fixed.
2016-09-01 18:01:55 +03:00
Denis Zharkov cebe67d90c Fix default value generation after suspension point
Replace coercion from VOID with call 'pushDefaultValueOnStack'

It's necessary because coercion of VOID to java/lang/Object ends with Unit instance on stack
that makes variables spilling algorithm thinking that variable is Unit

 #KT-13409 Fixed
2016-09-01 15:03:31 +03:00
Denis Zharkov 1226d8fc2c Refine 'handleResult' calls generation within coroutines
Before this change everything works just fine for 'handleResult' methods
accepting non-Unit parameters

For other cases the same coercion-to-unit strategy is in plain lambdas:
- if last statement is not Unit type, execute it, pop from the stack, then put Unit instance
- for 'return@label' (no expression) just put Unit on the stack

 #KT-13531 Fixed
2016-09-01 15:03:31 +03:00
Mikhail Glukhikh cd717467f0 Nested classes are no more allowed inside any anonymous objects or local classes #KT-13510 Fixed
(cherry picked from commit 5c3ec6c)
2016-08-31 19:28:13 +03:00
Mikhail Glukhikh f8039249c6 CFA: additional jumps to catch / finally generated in the end of try / before exits from try #KT-5469 Fixed
Also #KT-13612 Fixed
(cherry picked from commit 7c188b3)
2016-08-31 19:28:09 +03:00
Mikhail Glukhikh 6a9d058db4 UNUSED_VALUE is now reported on expression only if this expression is unused in all (e.g. finally) branches #KT-9825 Fixed
(cherry picked from commit aac8e94)
2016-08-31 19:28:00 +03:00
Alexander Udalov 3298649bd7 Support "-no-reflect" in "kotlin" command
#KT-13491 Fixed
2016-08-26 15:17:00 +03:00
Mikhail Glukhikh 25eefdb6ec Pseudocode label now cannot be bound to a non-owning pseudocode #KT-13555 Fixed
Also EA-77641 Fixed
(cherry picked from commit 07643ce)
2016-08-25 10:32:04 +03:00
Mikhail Glukhikh d08d8af407 USELESS_ELVIS_RIGHT_IS_NULL : build fix (add to different files in DiagnosticsTestGenerated), do not report if USELESS_ELVIS already exists
(cherry picked from commit c71b656)
2016-08-23 16:26:54 +03:00
shiraji a3f131d6c6 KT-13521 Warning right part of "expression ?: null" is useless
#KT-13521 Fixed
2016-08-23 01:10:10 +09:00
Mikhail Glukhikh ac3dfd93bd More correct handling of compile time constant types #KT-13421 Fixed 2016-08-18 14:42:16 +03:00
Mikhail Glukhikh ae856e834a Store map (Call to KotlinType) for SMARTCAST slice #KT-13426 Fixed
Also EA-86848 Fixed
2016-08-17 16:09:45 +03:00
Mikhail Glukhikh cbcef67d82 KT-13426: store map from ImplicitReceiver into KotlinType for implicit receiver smart casts 2016-08-17 16:09:34 +03:00
Ilya Gorbunov b69661df8f Pseudocode and CFG changed after 'let' is resolved correctly. 2016-08-17 12:40:50 +03:00
Ilya Gorbunov 58a010464a Exception typealiases rendering in test output (CFG) 2016-08-17 12:40:50 +03:00
Ilya Gorbunov 0ebfba7a1a Test data: do not use exceptions from java.lang, as they are not available in JS 2016-08-17 12:40:50 +03:00
Ilya Gorbunov d943079557 Exception typealiases rendering in test output 2016-08-17 12:40:50 +03:00
Michael Bogdanov e0d525b72a Support bound function reference inlining 2016-08-17 11:26:45 +03:00
Michael Bogdanov 7325baa06a Fix for KT-13374: CompilationException: Inline function call with anonymous object implementing an interface by delegation
#KT-13374 Fixed
2016-08-16 10:47:01 +03:00
Alexander Udalov 7b8ee5fba1 Add test case for obsolete issue
#KT-13172 Fixed
2016-08-15 19:41:47 +03:00
Alexander Udalov bd88b0941d Fix incorrect unsupported error on synthetic extension call on LHS of ::
#KT-13271 Fixed
2016-08-15 19:41:47 +03:00
Alexander Udalov 5b1ee13db8 Make KClasses for primitives equal to KClasses for wrapper types
Both primitive int and wrapper type java.lang.Integer are represented by the
single type kotlin.Int in Kotlin, so inequality between the corresponding
KClasses was confusing here. To keep the old behavior, one may call 'k1.java ==
k2.java' instead of `k1 == k2`

 #KT-13462 Fixed
2016-08-15 19:41:47 +03:00
Alexander Udalov 3efa738bc0 Fix NPE on .companionObjectInstance for built-in classes
#KT-13370 Fixed
2016-08-15 19:41:47 +03:00
Stanislav Erokhin 85a951db52 Fixed exception AssertionError: Illegal resolved call to variable with invoke
#KT-13330 Fixed
#KT-13349 Fixed
2016-08-15 19:24:17 +03:00
Mikhail Glukhikh 1c5c6506ce Report of UNINITIALIZED_ENUM_COMPANION also for implicit receivers #KT-11769 Fixed 2016-08-12 15:06:43 +03:00
Mikhail Glukhikh 04f71bccf2 KT-11769 case with companion function call: error is now detected if companion receiver is stated explicitly 2016-08-12 15:06:38 +03:00
Mikhail Glukhikh 6cf90cfc4e Fix for SOE in VarianceChecker #KT-13401 Fixed 2016-08-11 13:04:58 +03:00
Ilya Chernikov 46a7c706e1 Fixes and refactorings after review 2016-08-11 09:11:11 +02:00
Ilya Chernikov e99697e3a2 Fix testdata for cli help tests 2016-08-11 09:11:11 +02:00
Mikhail Glukhikh d21061ff60 CAST_NEVER_SUCCEEDS: some type alias tests (1.1 only!) 2016-08-10 12:23:09 +03:00
Mikhail Glukhikh 687698da9a Do not report USELESS_CAST when casting null to nullable (special case) 2016-08-10 12:23:02 +03:00
Mikhail Glukhikh 098520de64 CAST_NEVER_SUCCEEDS: do not report when casting nullable to nullable #KT-260 Fixed 2016-08-10 12:22:53 +03:00
Denis Zharkov 1df9724c0c Refine stack frames markup calculation
It fixes VerifyError with coroutines on Dalvik happening because of
variables spilling before/after suspension point

BasicInterpreter from ASM does not distinct 'int' types from other
int-like types like 'byte' or 'boolean', neither do HotSpot and JVM spec.
But it seems like Dalvik does not follow it, and spilling
boolean value into an 'int' field fails with VerifyError on Android 4,
so it's necessary to distinct int types for variables spilling

 #KT-13289 Fixed
2016-08-09 16:36:52 +03:00
Alexander Udalov 0d26087040 CLI, Ant: add kotlin-reflect.jar to classpath by default, support "-no-reflect"
Note that now "-no-stdlib" implies "-no-reflect".

 #KT-13237 Fixed
2016-08-09 11:24:24 +03:00
Mikhail Glukhikh 30fd22499b Test data fix (after cherry-pick from 1.0.4) 2016-08-09 10:32:15 +03:00