Commit Graph

3045 Commits

Author SHA1 Message Date
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 0ba0e2b10d Delete JavaTypeSubstitutorImpl, use PsiSubstitutor in JavaClassImpl
Also delete related tests
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
Denis Zharkov 26081bf817 Support loading Java annotations with TYPE_PARAMETER target 2016-03-16 20:23:01 +03:00
Denis Zharkov 78c9dffe00 Refine return type of MemberScope.getContributedFunctions 2016-03-16 20:22:58 +03:00
Alexander Udalov 4f77b02a58 Rename 'ins' -> 'Ins' in BuiltinsPackageFragment and related classes 2016-03-14 20:41:46 +03:00
Alexander Udalov 11409ec6cf Move some function type utilities from descriptors to frontend 2016-03-14 19:45:09 +03:00
Alexander Udalov 2ce661af98 Rename KotlinBuiltIns.getFunctionType -> createFunctionType, move to functionTypes.kt 2016-03-14 19:24:06 +03:00
Mikhail Glukhikh f76efb68f2 Strictfp on a class is now a warning #KT-11109 Fixed 2016-03-12 13:17:11 +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
Alexander Udalov bab127ad33 Remove some legacy codegen tests, move some to generated 2016-03-09 10:25:38 +03:00
Alexander Udalov 4553afbd0c Make PropertyAccessorDescriptor#hasBody a front-end utility 2016-03-03 16:08:18 +03:00
Denis Zharkov 56a2561ab9 Extract JvmMethodGenericSignature from JvmMethodSignature 2016-03-02 13:38:46 +03:00
Denis Zharkov 7bd8fa0b48 Optimize signature propagation
Do not collect super function with trivial signature
2016-03-02 13:38:46 +03:00
Denis Zharkov d66b9a08dd Do not map generic signature if it's unnecessary 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
Pavel V. Talanov b399bbffd7 Improve JvmConflictingDeclarations diagnostics rendering 2016-02-26 14:45:08 +03:00
Pavel V. Talanov ced5a6c917 Introduce RenderingContext and add as parameter to DiagnosticParameterRenderer#render
RenderingContext holds data about the whole diagnostics allowing to adjust rendering of its parameters
2016-02-26 14:45:04 +03:00
Pavel V. Talanov 4f18b3da53 Rename: Renderer -> DiagnosticParameterRenderer and move it out of descriptors module
DescriptorRenderer is no longer a renderer
DescriptorRenderers should not be used to render diagnostic parameters explicitly
2016-02-26 14:45:02 +03:00
Pavel V. Talanov 77f74a929a Revert 06215ca932
It led to parameter names missing in parameter info and completion for compiled java code used from kotlin
See KT-11039
2016-02-26 14:05:47 +03:00
Stanislav Erokhin 6591f8a2ab Minor. removed unused method from AdditionalTypeChecker. 2016-02-24 19:33:06 +03:00
Stanislav Erokhin 24829ee3ac Minor. rename 2016-02-24 19:33:06 +03:00
Stanislav Erokhin 665e13e4ec Remove obsolete code about warnings for expressions which can be null in java(has @Nullable annotation in java) and in kotlin not marked nullable.
After introducing flexible types and signature enhancement there is no more such expressions.
2016-02-24 19:33:05 +03:00
Alexander Udalov 1a5a077bd6 Replace map + filterNotNull -> mapNotNull in project 2016-02-20 19:05:30 +03:00
Natalia Ukhorskaya 42927bb078 Make function delegated to sam adapter synthetic 2016-02-17 15:08:53 +03:00
Denis Zharkov 961b72682a Drop unnecessary call to substituted 'overriddenDescriptors' 2016-02-16 12:01:13 +03:00
Denis Zharkov 44148107ae Optimize SamAdapterOverridabilityCondition
Do not calculate it for non-static members,
because SAM adapters only exist in static scope now
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
Denis Zharkov 1b4b8ab5db Memoize 'JavaTypeClassifierImpl.isRaw' result 2016-02-16 12:01:12 +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
Dmitry Petrov aed2f2b993 Property vs classifier conflict.
TODO get rid of duplicate diagnostics
(looks like OverloadResolver and DeclarationResolver are partially redundant; refactor them).
2016-02-11 10:32:46 +03:00
Pavel V. Talanov f59a4c537e Minor: remove some dead code 2016-02-08 16:45:46 +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 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
Dmitry Petrov 65f754ffca Fix KT-10764 IDEA doesn't show overload conflict between constructor and function...
When checking for overloads in package, consider functions and top-level class constructors as possibly conflicting between each other. NB OverloadUtil uses containing package scope from module descriptor.

Change diagnostic message for CONFLICTING_OVERLOAD: it's misleading in case of fun vs constructor conflict.

Add custom multifile test for diagnostics in IDE (probably not the best; should preprocess file content if it's required to check highlighting in multiple files, not only in the first file).

Add test for KT-10765 Incremental compilation misses overload conflict between constructor and function ...
2016-02-02 16:21:26 +03:00
Yan Zhulanow da7acd5e73 Check annotations on default property getter/setter 2016-02-02 13:14:56 +03:00
Dmitry Petrov 112e54b35a KT-10752: if (inferred) type for an expression refers to a Java class
non-accessible in the current context, it is a compiler error.
Otherwise we might generate a CHECKCAST instruction that causes IAE at run-time.
Here we are somewhat less permissive then Java
(see inaccessibleType.kt in diagnostics tests).
2016-01-29 10:30:00 +03:00
Dmitry Petrov 1b78d01ae6 Effective visibility issues in FileBasedKotlinClass.
Make exposed nested classes public.
2016-01-29 10:30:00 +03:00
Alexander Udalov b946d725d7 Filter out methods without return type to fix EA-73795 2016-01-28 21:48:16 +03:00
Denis Zharkov 29c24267fa Fix project compilation
First parameters of `DiagnosticFactory.on` methods are annotated as 'NotNull'
2016-01-28 08:36:24 +03:00
Ilya Gorbunov 744a7a83f7 Cleanup RC deprecations in compiler and plugin. 2016-01-27 18:34:30 +03:00
Mikhail Glukhikh 0368631aa3 Source code fix: exposed visibility in object members 2016-01-26 19:04:04 +03:00
Denis Zharkov 5baa0ed4bb Minor. Rename TypeUtils.containsSpecialType -> contains 2016-01-22 19:17:22 +03:00
Denis Zharkov a5c13ce8cf Approximate projections in SAM type when creating SAM adapter
Use the same approach as Java 8 applies to function types
(see non-wildcard parametrization in §9.9 of JLS)

 #KT-6918 Fixed
2016-01-22 19:17:22 +03:00
Ilya Gorbunov 1129cee0ff Collect nested classes from all 4 builtin packages. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov 9c0f0cad70 Packages: move collections to kotlin.collections. 2016-01-22 05:54:38 +03:00