Commit Graph

4274 Commits

Author SHA1 Message Date
Alexander Udalov 3f1533c35b Restore support for local class literals in annotation arguments
This was broken in c1ab08c8ce where we started to represent KClassValue
as a ClassId of the referenced class + number of times it's been wrapped
into kotlin.Array. Local classes do not have a sane ClassId, so in this
change we restore the old behavior by representing KClassValue with a
sealed class value instead

 #KT-29891 Fixed
2019-02-25 19:22:09 +01:00
Yan Zhulanow 47f0b68a8c Change mangling for destructured lambda parameters 2019-02-25 14:43:56 +03:00
Ilya Chernikov 29fa0f5dff Replace unnecessary direct usages of the LazyScriptDescriptor with ScriptDescriptor interface
lift result property to the interface to implement it
2019-02-21 15:59:48 +01:00
Alexander Udalov d267f1e875 JVM IR: generate synthetic $annotations methods for properties 2019-02-19 17:25:47 +01:00
Ilya Gorbunov 6bcd112062 Drop obsolete artifact kotlin-runtime
Remove suppresses used to compile some parts of stdlib
as a non-multiplatform project.
2019-02-18 19:20:30 +03:00
Alexander Udalov f2bf81e799 Fix UOE when using Java annotation with infinity/NaN as default value
The root problem is the fact that ConstantExpressionEvaluator returns
null for values such as infinity and NaN loaded from cls psi (see
IDEA-207252). This commit simply reverts a part of 8ab9226805 where we
started to compute default values more often than needed. In
LazyJavaClassMemberScope, we only need to check whether or not there
_is_ a default value, not compute its value.

 #KT-29792 Fixed
2019-02-15 19:13:53 +01:00
victor.petukhov cb5f497cbe Alphabetical sort wrapped intersection types for rendered diagnostics 2019-02-14 12:31:42 +03:00
Denis Zharkov abad408d7b Do not implicitly propagate deprecations originated in Java
^KT-29604 Fixed
2019-02-13 16:21:05 +03:00
Dmitriy Novozhilov 3f4df6160c Minor: reformat NewCapturedType.kt according to code style 2019-02-07 12:12:34 +03:00
Tor Norbye a42406f2aa KT-29586: Add android.annotation annotations
KT-29586 Fixed
2019-01-31 17:12:56 +03:00
Alexander Udalov 37a149b218 Allow to specify builtInsModule for DefaultBuiltIns
Similarly to JvmBuiltIns, this will be needed to load built-ins from
compilation dependencies rather than the compiler class loader
2019-01-28 15:18:53 +01:00
Alexander Udalov f2bf0dc236 Drop unneeded synthetic package fragment construction from KotlinBuiltIns
Instead use package views of builtInsModule
2019-01-28 15:18:52 +01:00
Alexander Udalov e19c6ce23c Use KotlinBuiltIns.getBuiltInsPackageScope instead of getBuiltInsPackageFragment
In general case, the module where built-ins are looked up
(builtInsModule) can have multiple package fragments corresponding to
the package "kotlin". Remove the misleading method
getBuiltInsPackageFragment along with its implementation details and use
the package view's scope instead (by changing
KotlinBuiltIns.getBuiltInsPackageScope), since it'll iterate over all
fragments accessible in the module and its dependencies.

The only difference between scopes of package fragment and package view
is that the latter also contains package views for subpackages, which is
why the change in BuiltInsReferenceResolverTest is necessary
2019-01-28 15:18:52 +01:00
Alexander Udalov a419112c25 Refactor class lookup methods in KotlinBuiltIns
Remove external usages of get*Nullable methods, inline/remove other
methods to simplify the API facade
2019-01-28 15:18:52 +01:00
Alexander Udalov aa8938cc1b Minor, cleanup KotlinBuiltIns
Remove unused code, fix inspections
2019-01-28 15:18:52 +01:00
Alexander Udalov 4a7bd9467c Remove obsolete BuiltInsInitializer
JvmBuiltIns do not use it for a long time already and work fine. It
seems that other implementations do not need it either
2019-01-28 15:18:52 +01:00
Sergey Rostov f35185b261 Build: remove explicit dependencies to org.jetbrains.annotations 2019-01-28 13:43:08 +03:00
Svyatoslav Kuzmich 8c89ffbe2d [JS IR BE] Load builtins from code to runtime
Bypass builtins deserialization mechanism in legacy JS backend and load
bultins direcly as kotlin code.

This way we won't have separated IR declarations for Enum, Char, Long

Some "native" builtins are implemented in libraries/stdlib/js/irRuntime/builtins/
Other builtins are moved by MoveExternalDeclarationsToSeparatePlace and
used only in compile-time
2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich a40448aebc [JS IR BE] Use unsigned types lowering lazily 2019-01-24 16:14:40 +03:00
Dmitriy Novozhilov 21f0557502 Fix compatibility of CapturedTypeConstructor and NewCapturedTypeConstructor
Now both of those classes implements one interface with `TypeProjection`
  property. That allows old captured type approximator use new captured types.

That change fixes tests related to diagnostics:
- SETTER_PROJECTED_OUT
- DEBUG_INFO_UNRESOLVED_WITH_TARGET
- UNRESOLVED_REFERENCE_WRONG_RECEIVER

Also `typeProjection` property renamed to `projection` according to naming in NI.
2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov 667f5032b6 Minor: reformat CapturedTypeConstructor.kt according to code style 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov 53432eaf99 Minor: reformat CapturedTypeApproximation.kt according to code style 2019-01-24 10:53:58 +03:00
Dmitry Petrov 360bfcaf6a KT-29340 Provide effective modality for enum class in IR
* if enum class has abstract members, then it is ABSTRACT
* otherwise, if enum class has entries with members, then it is OPEN
* otherwise, it is FINAL.
2019-01-22 10:52:54 +03:00
Vyacheslav Gerasimov f58acbeef5 Build: implement useBootstrapStdlib flag
Excludes stdlib projects from build and uses bootstrap stdlib artifacts

 #KT-29205
2019-01-21 21:09:40 +03:00
Vyacheslav Gerasimov 1ba80adc7f Build: Publish internal maven artifact for builtins
#KT-29204
2019-01-21 17:01:43 +03:00
Vyacheslav Gerasimov 46d9d5456f Build: Change builtins artifact configuration to default 2019-01-21 17:01:43 +03:00
Vyacheslav Gerasimov 0d8c779190 Build: Change builtins serialization task output directory to local 2019-01-21 17:01:43 +03:00
Vyacheslav Gerasimov c7ab69829e Build: Convert protobuf to includable build with maven publication
#KT-29202
2019-01-17 20:45:11 +03:00
Dmitry Savvinov 69fff12384 Drop LockBasedStorageManager.defaultDebugName, use meaningful name everywhere
Also, drop `createDelegatingWithSameLock` as it was unused
2019-01-14 11:10:37 +03:00
Ilya Gorbunov ef278ea030 Improve Any.equals/hashCode docs
- add code formatting
- remove 'reference' adjective, as Kotlin doesn't distinguish primitives from reference types
- add the requirement of inequality to null
- replace inaccurate note with a link to the reference (relates to KT-26604)

#KT-14866
2019-01-11 21:03:19 +03:00
Mikhael Bogdanov 8ce7112123 New tests for TYPE_USE annotations in enums and inner classes
Main test data  (testName.txt) a not totally valid cause of IDEA-205039.
 Javac test data (testName.javac.txt) a not valid
 cause of type annotations support absence.
 Runtime tests are disabled cause reflection support absence.
2019-01-08 13:52:45 +01:00
Mikhael Bogdanov dfee1787e5 Regenerate builtins 2019-01-02 14:47:48 +01:00
Mikhael Bogdanov cf47bc0130 Update copyright in generated compiler tests 2019-01-02 12:37:06 +01:00
Alexander Udalov 8ab9226805 Fix loading default Java annotation values in actual typealias from binary classes
#KT-22704 Fixed
2018-12-28 13:02:15 +01:00
Mikhail Glukhikh 8420fceb8c Support '.toType()' and literal fixes related to unsigned type mismatch
#KT-26836 Fixed
2018-12-26 18:21:49 +03:00
Mikhail Glukhikh d7ce79cc76 Suggest quick-fixes for SIGNED_CONSTANT_CONVERTED_TO_UNSIGNED
#KT-27590 Fixed
2018-12-26 18:21:49 +03:00
Sergey Rostov 883970fadb Add explicit dependencies to nullable annotations 2018-12-26 09:07:06 +03:00
Mikhail Zarechenskiy 84222afe2f Fix exception when expected type is subtype of a function type
#KT-28984 Fixed
 #EA-132850 Fixed
2018-12-24 19:41:51 +03:00
Mikhail Zarechenskiy e509649132 Fix mapping of platform inline class types
For the inline class:
 ```
 inline class IC(val x: Int)
 ```

 Type (IC..IC?) should be mapped to the wrapper `IC`
 because it can hold object and also because it does so for primitives

 #KT-28983 Fixed
2018-12-24 12:32:22 +03:00
Ilya Gorbunov 68f898153c Fix link to sealed classes doc page
#KT-28829 Fixed
2018-12-21 16:25:43 +03:00
Marcin Moskala 686cfa6fd2 Fix common misspellings 2018-12-21 16:13:42 +03:00
Mikhail Glukhikh ca3d758fba Create expect/actual class: fix inline class generation
#KT-28744 Fixed
#KT-28745 Fixed
2018-12-19 19:55:56 +03:00
Denis Zharkov a422db91b2 Transform KotlinClassFinder::findKotlinClass to extension 2018-12-13 20:38:25 +03:00
Denis Zharkov f153d97f40 Avoid multiple subsequent reading of the same class-file in front-end
^KT-23466 Fixed
2018-12-13 20:38:24 +03:00
Denis Zharkov e59d9bf9e4 Convert JavaClassFinder.java to kotlin 2018-12-13 20:37:46 +03:00
Denis Zharkov 9ddee565e0 Convert JavaClassFinder.java to kotlin: rename file 2018-12-13 20:37:46 +03:00
Denis Zharkov 0a70a957e9 Minor. Reformat LazyJavaPackageScope.kt 2018-12-13 20:37:46 +03:00
Ilya Chernikov 0b9770f8d1 Refactor scripting - rename env vars to provided properties everywhere 2018-12-13 18:00:12 +01:00
Yan Zhulanow 3c8714696d Add a LookupLocation to 'getSyntheticExtensionProperties()', use it in 'DebuggerFieldSyntheticScopeProvider' 2018-12-12 21:40:43 +09:00
Yan Zhulanow ada71ce3cd Evaluate: Use '<name>_field' syntax for field value evaluation (KT-14075) 2018-12-12 21:40:42 +09:00