Commit Graph

447 Commits

Author SHA1 Message Date
Andrey Breslav 583694a450 Flexible types for primitive arrays 2014-10-13 15:37:54 +04:00
Andrey Breslav dd2e95b3bc Substitution implemented for flexible occurrences of Java type parameters 2014-10-13 15:37:52 +04:00
Andrey Breslav bf53222bd9 Flexible types in SAM conversions 2014-10-13 15:37:51 +04:00
Andrey Breslav 2529bb24d1 Don't create flexible types for ".class" expressions in annotation arguments 2014-10-13 15:37:51 +04:00
Andrey Breslav c699fa96d9 Make not-null compile-time constants non-flexible 2014-10-13 15:37:51 +04:00
Andrey Breslav 867956729b Don't create platform types for annotation members 2014-10-13 15:37:50 +04:00
Andrey Breslav b665a1998b Supertypes should not be flexible 2014-10-13 15:37:47 +04:00
Andrey Breslav f11095b1d0 Minor. DelegatingFlexibleType moved to top level 2014-10-13 15:37:45 +04:00
Andrey Breslav e268e74fa3 Flexible types added to JDR
So far they act exactly like inflexible ones
2014-10-13 15:37:42 +04:00
Andrey Breslav ad8de070fa A flag in the JDR to govern usage of platform types 2014-10-13 15:37:42 +04:00
Michael Bogdanov 1944f75802 Skip default methods on single abstract method search
Fix for KT-4886: SAM conversion doesn't work for interfaces with default methods

  #KT-4886 Fixed
2014-10-09 17:15:46 +04:00
Svetlana Isakova 20f3403c80 Rename: this object, receiver argument -> dispatch receiver, extension receiver 2014-10-01 18:52:51 +04:00
Alexander Udalov 96308aa14e Increase ABI version
After changes to package part names and top level closure names
2014-09-26 10:23:21 +04:00
Alexander Udalov c57441b51b Use '$' instead of '-' in package part class names
Otherwise some tools break (e.g. CheckMethodAdapter in ASM, used in generic
signature writer) because they expect class names to be Java identifiers.

Some tests fixed, some will be fixed in future commits
2014-09-26 10:22:20 +04:00
Alexander Udalov 1905401273 Move ClassId to module descriptors, closer to other names 2014-09-16 11:36:39 +04:00
Alexander Udalov ed92eb1d17 Minor, use another constructor of ClassId 2014-09-16 11:32:45 +04:00
Alexander Udalov 73a92c6aa9 Remove JavaClass.getAllMethods()/getAllFields()
Their behavior is different in PSI and reflection (two things that this
interface is supposed to unify), so there's no point in making it interface
methods, rather we should just walk supertype hierarchy manually

Also make JavaClassImpl.getSupertypes() invoke PsiClass.getSuperTypes(),
because it also contains java.lang.Object for interfaces, which makes
equals/hashCode/toString appear in interfaces' getAllMethods() as well
2014-09-15 19:30:53 +04:00
Alexander Udalov 3485d65d8a Remove superfluous isVararg() from JavaMethod 2014-09-15 19:30:52 +04:00
Alexander Udalov 924283d2d9 Extract JavaConstructor out of JavaMethod
Will be useful in reflection-backed implementation of Java structure, where
Constructor is not a Method and doesn't even inherit from it
2014-09-15 19:30:52 +04:00
Alexander Udalov 7595e32bb6 Use ClassId instead of JvmClassName in KotlinJvmBinaryClass
ClassId contains exact information about origin of the class (e.g. if '$' in
the class name denotes nested classes separator or just a character in the
name)
2014-09-15 19:30:51 +04:00
Alexander Udalov e3b01f073f Replace FqName by ClassId where possible in Java resolver 2014-09-15 19:30:51 +04:00
Alexander Udalov a8c5f1bb3a Drop KotlinClassFinder#findKotlinClass(FqName)
findKotlinClass(ClassId) should be used instead
2014-09-15 19:30:50 +04:00
Alexander Udalov 422e922c36 Make JavaClassFinder accept ClassId rather than FqName
ClassId has more information about the name which will be very useful when
implementing JavaClassFinder in reflection
2014-09-15 19:30:50 +04:00
Alexander Udalov e9ae06a53e Straighten out MemberIndex calculation in LazyJavaStaticScope
Also delete confusing "inn" function
2014-09-15 19:30:50 +04:00
Alexander Udalov 0cb7c08a7a Minor, delete unneeded underscores from parameter names 2014-09-15 19:30:50 +04:00
Alexander Udalov bc1d59a538 Add KotlinClassFinder#findKotlinClass(ClassId)
Will be used to load nested classes correctly at runtime
2014-09-15 19:30:50 +04:00
Alexander Udalov c854b1d713 Unextend JavaAnnotationArgumentImpl from JavaElementImpl 2014-09-15 19:30:49 +04:00
Alexander Udalov 4c51368244 Rewrite JavaAnnotationArgument interfaces and implementations to Kotlin 2014-09-15 19:30:49 +04:00
Alexander Udalov ec02382976 Assert that reference annotation argument is always an enum value
Rename JavaReferenceAnnotationArgument on that occasion to
JavaEnumValueAnnotationArgument. Also add a test on a nested enum annotation
argument
2014-09-15 19:30:49 +04:00
Alexander Udalov 2f12875515 Extract "values" and "valueOf" names as static constants 2014-09-09 20:42:38 +04:00
Alexander Udalov 4bd603818a Drop LazyJavaDescriptor, JavaPackageFragmentDescriptor 2014-09-09 20:42:38 +04:00
Alexander Udalov 148d583212 Drop JavaPackageFragmentProvider 2014-09-09 20:42:38 +04:00
Alexander Udalov b52f337f7f Drop enum class object hack
Place valueOf() and values() into the static scope of the corresponding enum
class

 #KT-5580 Fixed
 #KT-2410 Fixed
2014-09-09 20:42:37 +04:00
Alexander Udalov 8ccca1781d Support static class scope in frontend, JVM codegen and IDE 2014-09-09 20:42:36 +04:00
Alexander Udalov 76986f850f Drop outdated code in JDR related to static class members 2014-09-09 20:42:36 +04:00
Alexander Udalov bcfb5f3b09 Rewrite Java resolve to use static class scope instead of synthesized packages
#KT-4149 Fixed
 #KT-4839 Fixed
2014-09-09 20:42:36 +04:00
Alexander Udalov 75df4a9ad8 Introduce ClassDescriptor#getStaticScope()
Will be used to exterminate hacks related to static Java methods in our
codebase: synthetic class object for enum, synthetic package for static members
of Java classes, etc.
2014-09-09 20:42:35 +04:00
Pavel V. Talanov 5dc5862134 Add missing public to ModuleClassResolver 2014-08-23 12:52:27 +04:00
Pavel V. Talanov 46f1873dc8 JDR: drop various code that is marked as temporary
Remove additional logic for comparing files in JavaClassFinderImpl
Drop redundant check for builtins in findClassInJava(FqName)
Drop resolve cache query in LazyJavaClassMemberScope and LazyJavaPackageFragmentScope
2014-08-22 22:59:07 +04:00
Pavel V. Talanov db5303c019 Implement modules in IDE
IDE:
Rewrite AnalyzerFacade and implementations for JS and JVM to support creating separate analyzers for each module
Introduce ModuleInfo which is an intermediate entity between configuration (tests or idea modules) and ModuleDescriptor
Implement IdeaModuleInfos which represent IDEA modules, sdks and libraries
Add (somewhat thin) test checking their behaviour
Implement getModuleInfo() - utility to obtain IdeaModuleInfo for PsiElement
Drop Project.getLazyResolveSession() - not possible to obtain resolve session for the whole project any more
Adjust JavaResolveExtension accordingly
KotlinSignature Intention/Marker - make sure that analyzed element is cls element (he's not in resolve scope otherwise)

LightClasses:
Create separate package light classes for each module
Java code can only reference light class from the first module among it's dependencies
Duplicate jvm signature is only reported on package declarations inside one module

Injectors:
Receive GlobalSearchScope as paramer for VirtualFileFinder and JavaClassFinder
which allows to narrow analyzer scope

JDR:
Introduce ModuleClassResolver resolves java classes in correct java descriptor resolver (corresponding ModuleDescriptor)
Add test checking that java classes belong to correct module

Debugger:
Provide context to analyze files created by debugger in

Converter:
Postprocessor now needs a context to analyze resulting code in

JetPsiFactory:
Add verification that files created by psi factory are not analyzed without context (that is almost never a good idea)

Other:
Use new API in various tests, utilities, run configuration producers and builtin serializers
Various "TODO: (module refactoring)" which mark the unfinished parts
2014-08-22 22:58:54 +04:00
Pavel V. Talanov 92b29a8fe7 Rewrite KotlinClassFinder to Kotlin 2014-08-15 15:22:15 +04:00
Alexander Udalov 4ff6a627d0 Get rid of isConstructorOfStaticNestedClass()
This value can always be computed in ConstructorDescriptorImpl#initialize
2014-08-13 15:13:23 +04:00
Pavel V. Talanov 6588310736 Add missing public modifiers in project code 2014-08-12 21:13:46 +04:00
Pavel V. Talanov a5a493d145 Minor: remove obsolete JAVA_ROOT 2014-08-08 19:50:58 +04:00
Pavel V. Talanov b02d4b0669 Utilities to resolve Java methods and fields 2014-08-08 19:50:56 +04:00
Pavel V. Talanov 1488584acf Rewrite JavaDescriptorResolver to Kotlin 2014-08-08 19:50:55 +04:00
Andrey Breslav 1de3ba9265 Minor. JavaDescriptorResolver renamed to .kt to preserve history 2014-08-08 19:50:53 +04:00
Alexey Sedunov 311166737f Associate synthetic component function descriptors with corresponding
constructor parameters
2014-08-08 18:59:45 +04:00
Alexander Udalov de0f751207 Replace object$ -> OBJECT$, instance$ -> INSTANCE$ in the project 2014-07-26 00:21:05 +04:00
Alexander Udalov 93fa7cb330 Increase ABI version
Related changes include:
- kotlin.Unit is now a named object
- "instance$" was renamed to "INSTANCE$"
- "object$" was renamed to "OBJECT$"
- Intrinsics#stupidSync() was dropped
2014-07-25 21:34:12 +04:00