Commit Graph

1122 Commits

Author SHA1 Message Date
Denis Zharkov e54b25a35a Fix StackOverflowError while mapping recursive intersection-type
#KT-10972 Fixed
2016-03-18 19:07:27 +03:00
Alexander Udalov 0fd8bec2ef Convert Java model to Kotlin, put in several files
Also move JavaPropertyInitializerEvaluator to ../components/
2016-03-18 14:48:58 +03:00
Alexander Udalov 0d74fc2290 Minor cleanup in Java model: fix warnings, remove unused 2016-03-18 14:48:57 +03:00
Alexander Udalov 0a54464420 Minor, JavaClass#getOriginKind -> isKotlinLightClass 2016-03-18 14:48:56 +03:00
Alexander Udalov 291c713d8b Cleanup JavaElement model from methods used only in substitutor
Downcast everything used in JavaTypeSubstitutorImpl to *Impl, remove methods
from interfaces, inline/move some of them
2016-03-18 14:48:55 +03:00
Alexander Udalov 26bf0dca13 Remove interface JavaTypeSubstitutor, use implementation
After 151e55b JavaTypeSubstitutor is only used from inside PSI-based
implementation of Java structure
2016-03-18 14:48:55 +03:00
Alexander Udalov 13ae3d96ab Simplify TypeConstructorImpl, extend it from AbstractClassTypeConstructor 2016-03-18 14:20:43 +03:00
Denis Zharkov fecb64560b Minor. Decrease method visibility 2016-03-16 20:23:42 +03:00
Denis Zharkov 26081bf817 Support loading Java annotations with TYPE_PARAMETER target 2016-03-16 20:23:01 +03:00
Denis Zharkov c9c9f7ff38 Minor. Simplify LazyJavaClassMemberScope.getFunctionsFromSupertypes 2016-03-16 20:22:58 +03:00
Denis Zharkov 78c9dffe00 Refine return type of MemberScope.getContributedFunctions 2016-03-16 20:22:58 +03:00
Denis Zharkov 151e55b2fa Use descriptors for building SAM constructors
It helps to get rid of semantics duplicating and fixes known bugs

- SOE in OnlyAbstractMethodFinder.find
- type enhancement for SAM constructors

 #KT-11287 Fixed
 #KT-11322 Fixed
 EA-77989 Fixed
2016-03-10 16:49:00 +03:00
Denis Zharkov b8b48c5f98 Extract common logic into AbstractTypeConstructor
Mostly it's about detecting loops in supertypes

Test data changes:
- Loops are being disconnected in Java classes too
- functions.kt: loops disconnection mechanism runs supertypes calculation,
so when we start check T it forces F' supertypes calculation, that ends
with CYCLIC_GENERIC_UPPER_BOUND reported on F

 #KT-11287 In Progress
2016-03-10 16:49:00 +03:00
Alexander Udalov 4553afbd0c Make PropertyAccessorDescriptor#hasBody a front-end utility 2016-03-03 16:08:18 +03:00
Alexander Udalov 6429dd4b04 Preserve JavaPropertyDescriptor type in substitution/copy
JavaPropertyDescriptor.substitute should return JavaPropertyDescriptor,
similarly to what's happening in JavaMethodDescriptor
2016-03-03 16:08:18 +03:00
Alexander Udalov 371051b1d6 Filter out package members from other facades in KPackageImpl
#KT-10690 Fixed
2016-03-03 16:08:18 +03:00
Valentin Kipyatkov 5aca50b4ca Enhanced constructor descriptor should not loose its source!
#KT-11256 Fixed
2016-03-02 21:43:43 +03:00
Denis Zharkov eb2c584578 Rename JetTypeMapper 2016-03-02 13:38:46 +03:00
Denis Zharkov 4583283515 Search classes by JavaClass through package scope 2016-03-02 13:38:46 +03:00
Denis Zharkov 3652cd9c18 Optimize top level class searching in LazyJavaPackageScope
Do not try to search something, that is known not to exist
2016-03-02 13:38:46 +03:00
Alexander Udalov 1a5a077bd6 Replace map + filterNotNull -> mapNotNull in project 2016-02-20 19:05:30 +03:00
Alexander Udalov 1b8f934b54 Delete deprecated enum 'values' property 2016-02-19 22:28:44 +03:00
Dmitry Petrov 30c2abba3c KT-9550: distinguish signature conflict on override from signature conflict of inherited members.
Add a common OverridingStrategy class for cases where we don't care (yet) about precise diagnostics.
2016-02-19 15:59:08 +03:00
Michael Bogdanov af3437626b Properly calculate isConst for java properties 2016-02-17 16:53:17 +03:00
Denis Zharkov 87497a5dc6 Do not run enhancement for fake overrides with one overridden 2016-02-16 12:01:13 +03:00
Denis Zharkov 42d451f2d1 Optimize ErasedOverridabilityCondition
Do not start substitution if some basic conditions are failed
2016-02-16 12:01:13 +03:00
Denis Zharkov 9f22b17918 Optimize external overridability conditions
- Skip ones that can lead only to success after first success
- And vice versa
2016-02-16 12:01:13 +03:00
Pavel V. Talanov 1800e5a7db Remove some usages of Name.guess (and rename this utility to discourage new usages) 2016-02-15 13:32:42 +03:00
Jake Wharton f713adc96e Add support for AOSP's nullability annotations.
These are different than 'android.support.annotation' in that they are used on the JVM for projects within AOSP.
2016-02-15 11:32:09 +03:00
Pavel V. Talanov 7d98103c0c overriddenDescriptors is empty for java static property and function declarations
Fake overrides are still created for java static with non-empty overriddenDescriptors

Add tests for inheriting visibility for java static members
Add test: check that java static declarations that shadow deprecated declarations should not be deprecated
Add test for corner case where "overriding" java static constant led to incorrect type in inheritor

Fix test data for existing tests
2016-02-11 14:08:14 +03:00
Pavel V. Talanov 7e78e8d8ab Refactor: Move and rename OverridingUtil.DescriptorSink -> OverridingStrategy 2016-02-11 14:08:13 +03:00
Nikolay Krasko 99a693a14b Too many empty ArrayList stored for arguments 2016-02-08 16:43:54 +03:00
Denis Zharkov c879f83037 Fix primitive types mapping
Use boxed version if type was enhaced to not-nullable
2016-02-08 16:40:47 +03:00
Denis Zharkov 18e7272a1e Do not force overridden descriptors computation
Currently 'overriddenDescriptors' of substituted function is lazy
and in most cases it's unnecessary to compute it
(it's enough to use the same field from 'original')
2016-02-08 16:40:47 +03:00
Denis Zharkov fae6de9acd Replace 'addOverriddenDescriptor' with 'setOverriddenDescriptors'
It helps to get rid of redundant SmartSets (e.g. for top-level functions)
2016-02-08 16:40:47 +03:00
Denis Zharkov c1f57b743b Do not build enhanced descriptors if they are unchanged 2016-02-08 16:40:47 +03:00
Denis Zharkov 924d706e79 Release original Java descriptors while enhancing
It's both more correct and helps to release memory retained by
descriptor before enhancement
2016-02-08 16:40:47 +03:00
Alexander Udalov 8800782c83 Move constants from JvmAnnotationNames closer to usages 2016-02-06 15:53:55 +05:30
Alexander Udalov 2f5a6ac465 Minor, add extra constant to JvmAnnotationNames, drop unneeded utility 2016-02-06 15:53:55 +05:30
Alexander Udalov 5de1cf3bb4 Do not write old metadata annotations to bytecode 2016-02-06 15:53:55 +05:30
Ilya Gorbunov a12fe2c18a Do not use inline-only in java 2016-02-01 22:09:17 +03:00
Denis Zharkov 6b33e3fb67 Minor. Rename variables and add assertion 2016-01-29 14:36:53 +03:00
Denis Zharkov 11a96ee8c8 Introduce not null type parameter capability
Java nullability annotations may generate types that currently are not denotable in Kotlin:
class Java {
  void <F> foo(@NotNull F f) {}
}

Type of given value parameter should be not nullable under any substitution:
String/String?/String! because of annotation contract.

NB: Currently there is no full analogues for such types in pure kotlin
2016-01-28 08:36:23 +03:00
Denis Zharkov 08dd675fcd Minor. Drop unused property 2016-01-28 08:36:23 +03:00
Denis Zharkov 6542d091ee Support generic constructors defined in Java
#KT-10686 Fixed
 #KT-10410 Fixed
2016-01-28 08:35:18 +03:00
Ilya Gorbunov 744a7a83f7 Cleanup RC deprecations in compiler and plugin. 2016-01-27 18:34:30 +03:00
Alexey Tsvetkov 56942930c9 Minor: remove unreachable code 2016-01-27 12:28:44 +03:00
Yan Zhulanow 0304bd1dc1 More precise diagnostic messages about "operator modifier is not applicable" 2016-01-26 17:21:44 +03:00
Denis Zharkov f560799bb7 Support top level wildcard types
#EA-73650 Fixed
2016-01-26 16:41:29 +03:00
Alexander Udalov 7981e5aa3a Increase metadata version to 1.1, hardcode incompatibility with 1.0
Add a temporary option to suppress incompatibility errors when compiling Kotlin
against current IDEA libraries until they are migrated
2016-01-23 10:00:19 +03:00