Commit Graph

2686 Commits

Author SHA1 Message Date
Ilya Gorbunov 03816373b3 Primitive array constructor-like functions with init lambda.
#KT-8831

Update testData and resolve ambiguity in newArray test
2015-12-18 17:54:09 +03:00
Denis Zharkov 1a6f9b8d1c Do not build inner type for error classes
#KT-10409 Fixed
2015-12-17 19:56:38 +03:00
Mikhail Glukhikh f5989aa4f2 CallableMemberDescriptor.isOverridable / ClassDescriptor.isFinal refactoring
Extra JvmField and integer constants tests
2015-12-17 18:11:41 +03:00
Alexey Tsvetkov 7384d25cb3 Prohibit Array<Nothing> 2015-12-17 16:26:26 +03:00
Mikhail Glukhikh 3fb04aceb9 Check backing field availability for AnnotationTarget.FIELD #KT-10387 Fixed
Some duplicated checks deleted (UseSiteTargetChecker / JvmFieldApplicabilityChecker)
2015-12-17 15:06:58 +03:00
Michael Bogdanov ca9e8fc5a7 Fix for KT-5910: Can't call Throwable() in Kotlin
#KT-5910 Fixed
2015-12-17 14:09:15 +03:00
Alexander Udalov dc84445e2e Inherit KProperty interfaces from function types
To be able to write the following: listOfStrings.map(String::length)
2015-12-16 19:48:28 +03:00
Stanislav Erokhin c725ed47f5 Replaced ReceiverValue.NO_RECEIVER to null. 2015-12-15 23:09:20 +03:00
Stanislav Erokhin 3692318c38 Minor. Removed ReceiverValue.IRRELEVANT_RECEIVER. 2015-12-15 23:08:41 +03:00
Pavel V. Talanov 3f0d71411e KtDecompiledFile: hack to be able to navigate to builtIns on jvm
Which sometimes are loaded differently than they are rendered (see BuiltInClassesAreSerializableOnJvm)
2015-12-15 20:22:06 +03:00
Zalim Bashorov 976fbf32ba Minor: use List instead of Array as container in chained scopes 2015-12-15 20:07:37 +03:00
Zalim Bashorov 5008a66a5b ChainedScope -> ChainedMemberScope 2015-12-15 20:07:36 +03:00
Denis Zharkov 7756644eb1 Introduce KClass<T>.javaPrimitiveType and KClass<T>.javaObjectType
#KT-6319 Fixed
2015-12-15 16:18:31 +03:00
Denis Zharkov 5df2a58003 Minor. Adjust generic parameter naming 2015-12-15 16:18:31 +03:00
Denis Zharkov b4bb92d136 Fix overload resolution ambiguity for types intersection
There are two different forms of types intestion:
1. Type parameters with multiple bounds
2. Smart casts

The problem was that when member scope of type intersection contained
effective duplicates and that lead to overload resolution ambiguity in
strange cases like `x.hashCode()`

For first type we do effectively the same thing as when building member
scope for class extending several interfaces: group all descriptors by
both-way-overridability relation and then choose most-specific in each
group.

For smart casts we do basically the same thing but with special
treatments:
1. From all descriptors that _equal_ to most specific we choose
   the one that works without smartcast if possible (i.e. we choose first from candidates list)
2. If smart-cast value seems to be unstable we use only member scope
   of receiver type + all descriptors from smart cast possible types
   that has incompatible signature. If we'd include all of them and
   choose one as more specific, and it would lead to false
   SMART_CAST_IMPOSIBLE (see test unstableSmartCast.kt)

 #KT-3996 Fixed
 #KT-10315 Fixed
2015-12-15 16:18:31 +03:00
Denis Zharkov 8d0c3281cd Choose first non-flexible when selecting most specific 2015-12-15 16:18:31 +03:00
Dmitry Petrov 02311538d6 Refactor createAntBindFakeOverride.
Drop unneeded helper functions from overridingUtils.kt
2015-12-15 16:18:30 +03:00
Ilya Gorbunov f509937037 Move array constructors to builtins module back to kotlin package. 2015-12-14 04:29:11 +03:00
Ilya Gorbunov 5aff07561d Move jvm annotations and class mapping intrinsics to runtime.jvm module to kotlin.jvm package.
Make annotationClass to be a property.
Deprecate with error javaClass property on KClass<T>
2015-12-14 03:51:07 +03:00
Alexander Udalov 6f347f351a Load annotations on compiled Kotlin enum entries
#KT-10339 Fixed
2015-12-13 03:52:42 +03:00
Alexander Udalov 3e2eb8c1a0 Serialize/deserialize annotations on enum entries
#KT-10338 Fixed
2015-12-13 03:52:41 +03:00
Denis Zharkov 871fe7680b Load special override as HIDDEN in case of signature clash
#KT-10151 Fixed
2015-12-11 22:41:03 +03:00
Denis Zharkov 45c0bc3610 Add 'subClassDescriptor' parameter to ExternalOverridabilityCondition 2015-12-11 22:41:03 +03:00
Denis Zharkov 417ff281ee Split getOverriddenBuiltinWithJvmDescriptor into two extensions 2015-12-11 22:41:02 +03:00
Stanislav Erokhin 1dca49cecc Workaround for tower resolution algorithm in kotlin code. Will be investigated. 2015-12-11 17:01:01 +03:00
Mikhail Glukhikh e7fc6bcc6e BuiltIns refactoring: getEnumEntry 2015-12-11 11:11:46 +03:00
Mikhail Glukhikh c8b50eec1e Enum.values: deprecation (warning) --> deprecation (error) 2015-12-11 11:11:42 +03:00
Mikhail Glukhikh 521b216602 Migration: Enum.values to Enum.values() 2015-12-11 11:11:38 +03:00
Dmitry Petrov 0fe74a8b43 COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT is an ERROR now.
Migrated code.
Updated test data in IDE tests.
Dropped whenWithRangeTestsAndMultiConditions.kt:
"Introduce subject" is not applicable to 'when' with ||-ed conditions.
2015-12-11 10:43:16 +03:00
Alexey Tsvetkov 199827635f Reserve 'typeof' as a keyword 2015-12-10 21:26:41 +03:00
Pavel V. Talanov 280e00981f Load java: load annotations on enum entries 2015-12-10 11:12:23 +03:00
Mikhail Glukhikh 9a4eb2a368 Refactoring: ClassDescriptor.isFinal, no more Modality.isOverridable 2015-12-09 19:27:47 +03:00
Mikhail Glukhikh fb406bfc24 Refactoring: CallableMemberDescriptor.isOverridable 2015-12-09 19:27:04 +03:00
Mikhail Glukhikh c73f01927a 'sealed' is now not 'final' by default + related code changes #KT-10266 Fixed 2015-12-09 19:19:04 +03:00
Mikhail Glukhikh 5b72afe8a0 J2K: Modality.kt 2015-12-09 19:19:00 +03:00
Mikhail Glukhikh d80206376a Modality.java --> Modality.kt 2015-12-09 19:18:56 +03:00
Pavel V. Talanov 7e6bed7ad8 Decompiled text: should always render all modifiers even if we don't feel like it 2015-12-09 18:51:31 +03:00
Pavel V. Talanov fee19ad9de CallableClsStubBuilder: correctly decide whether callable is extension 2015-12-09 18:51:30 +03:00
Pavel V. Talanov c40d6af1e5 Decompile builtins (kotlin_class and kotlin_package files)
The main purpose of this is to be able to index builtin declarations and enable go to symbol/class functionality in ide
Also it makes sense to show builtin classes (Any, Int ...) as classes when browsing kotlin-runtime.jar

Refactor decompiler code to eliminate existing and potential duplication
Share the code between js (kjsm) decompilation and builtin decompilation heavily
2015-12-09 18:51:28 +03:00
Pavel V. Talanov 6164566cad Extract duplicate logic between javascript and builtins serialization/deserialization 2015-12-09 18:51:27 +03:00
Pavel V. Talanov 34c3c04ead Implement NameResolverImpl#getPackageFqName(index) 2015-12-09 18:51:26 +03:00
Pavel V. Talanov 5846769b43 J2K NameResolverImpl: convert 2015-12-09 18:51:26 +03:00
Pavel V. Talanov 9ff6be6f0f J2K NameResolverImpl: rename file 2015-12-09 18:51:25 +03:00
Pavel V. Talanov f05de6d6eb Add package_fq_name field extension to builtins.proto 2015-12-09 18:51:24 +03:00
Dmitry Petrov 94bea54db3 Change "most specific return type" definition for fake overrides.
Given overridden descriptors D = d[i].
1. Find D*, subset of D:
  returnType(d* from D*) <: returnType(d) for each d from D.
  Always prefer var to val.
2. Prefer non-flexible return type to flexible.

Check for var/val overrides properly
(NB: this will report PROPERTY_TYPE_MISMATCH_ON_OVERRIDE
for all properties, not just overrides involving vars as it was before).
2015-12-09 17:43:48 +03:00
Dmitry Petrov ef72c594c4 KT-1934 & KT-10197:
Naive approximation for fake overriding signature:
use upper bound for flexible types.
Check delegation errors.
2015-12-09 17:43:47 +03:00
Dmitry Petrov 135c30323b KT-1934 Check inherited signatures for compatibility
Overridden signatures should have compatible return types
(equal types for 'var').
Only relevant overrides should be taken into account.
Refactor inherited signatures check,
introduce a strategy interface for problem reporting.
2015-12-09 17:43:47 +03:00
Andrey Breslav 83189013c6 Minor. Drop deprecated unary operator names from JS back-end 2015-12-09 17:10:30 +03:00
Andrey Breslav 0a0e4f1ba2 Minor. Clean up the code in OperatorChecker.kt 2015-12-09 17:10:30 +03:00
Andrey Breslav 3eeab68261 Signature checks fixed for plus() and minus() 2015-12-09 17:10:30 +03:00