Commit Graph

647 Commits

Author SHA1 Message Date
Svetlana Isakova e0f37bbef0 Generate parse error on label without name '@' 2014-05-20 15:07:03 +04:00
Svetlana Isakova 3bcdbee2bf Removed LabelName class, used Name instead 2014-05-20 14:58:49 +04:00
Alexander Udalov 98f80fe1e0 Increase ABI version after changes to FunctionImpl* classes 2014-05-19 19:50:59 +04:00
Alexander Udalov 54c21ffbf3 Delete K*FunctionNImpl classes
In favor of KFunctionImpl, KMemberFunctionImpl and KExtensionFunctionImpl
2014-05-19 19:50:59 +04:00
Alexander Udalov 8f7c0f0b65 Introduce KFunctionImpl, KMemberFunctionImpl, KExtensionFunctionImpl
Old 23*3 classes will be dropped, since they have no value.

Simplify JvmFunctionImplTypes significantly because of that
2014-05-19 19:50:59 +04:00
Alexander Udalov ccead8e337 Replace some usages of ERROR_CLASS with new instance creation
Because when some class is unresolved, we can still hold some information such
as its FQ name, for debugging purposes and better error messages
2014-05-19 19:50:59 +04:00
Alexander Udalov 54a44b1533 Introduce AbstractTypeParameterDescriptor
- pull the logic up from TypeParameterDescriptorImpl and
  AbstractLazyTypeParameterDescriptor (it was mostly duplicated)
- delete some unused methods
2014-05-19 19:50:59 +04:00
Alexander Udalov 31e8622471 Remove suspicious JetTypeImpl constructors
Most of the time they were used for classes without type parameters, and
getDefaultType() is supposed to be used there (additionally it may be cached)
2014-05-19 19:50:59 +04:00
Alexander Udalov 3ffa7cdcf8 Minor optimization in KotlinBuiltIns.isSpecialClassWithNoSupertypes 2014-05-19 19:50:58 +04:00
Alexander Udalov 5fdb9e6218 Change logic of loading "suppress" annotation class descriptor
Instead of loading the descriptor and checking equals(), we now check if the
annotation is in fact "suppress" by simply comparing its FQ name. This allows
us to suppress warnings while compiling built-ins: the problem is that
built-ins have its own "suppress" annotation class (defined in the sources)
which differs from the one loaded by the compiler (from kotlin-compiler.jar)
2014-05-19 19:50:58 +04:00
Alexander Udalov 5488a8402f Move and rename KFunctionImpl classes
Move from package "kotlin.reflect" to "kotlin.reflect.jvm.internal". They are
internal detail of the compiler and should not be used directly (especially now
that "kotlin.reflect" is in default import paths).

Also rename "KFunctionImplN" to "KFunctionNImpl", because this name makes more
sense
2014-05-19 19:50:58 +04:00
Alexander Udalov de8b2b3668 Fix generic signature for SAM adapters and constructors
SAM-related code in codegen was using JavaClassDescriptor directly, which has
an erased signature. Create and use a new abstraction SamType which has a full
generic signature of a type which was used in the SAM construct
2014-05-19 19:50:58 +04:00
Alexander Udalov 51a16fe491 Drop FunctionImplN and ExtensionFunctionImplN
We have FunctionImpl and ExtensionFunctionImpl classes now (2 classes, not 46)
2014-05-19 19:50:58 +04:00
Alexander Udalov 41eb0deaa0 Introduce FunctionImpl and ExtensionFunctionImpl classes
Old FunctionImpl0,1,2,... will be dropped since they had no purpose
2014-05-19 19:50:58 +04:00
Alexander Udalov 845e3323f9 Create error type if reflection class isn't found
Introduce a new diagnostic fired when reflection types aren't found in the
classpath
2014-05-19 19:50:57 +04:00
Alexander Udalov 0c2c203e96 Move KFunctionN classes to package "kotlin.reflect" 2014-05-19 19:50:57 +04:00
Alexander Udalov c7a7f31e82 Introduce module 'reflection', move KFunctionN to it
Metadata for KFunction classes is now longer serialized along with built-in
classes. This effectively means that it's no longer possible to find KFunction
classes via dependency on built-ins. There should be a kotlin-runtime library
in the specified classpath for reflection types to be resolvable.

A lot of tests were moved and changed, because tests on callable references
require stdlib in classpath from now on
2014-05-19 19:50:57 +04:00
Alexander Udalov c1cd8bf069 Use module instead of KotlinBuiltIns in ReflectionTypes 2014-05-19 19:50:56 +04:00
Alexander Udalov b27b8bf8b2 Extract DescriptorUtils.getContainingModule() 2014-05-19 19:50:56 +04:00
Andrey Breslav 7bce9060e2 Better handling of PackageTypes in KotlinBuiltIns 2014-05-19 19:28:14 +04:00
Andrey Breslav f72dcb8ee2 Fix for EA-53605 - UOE: PackageType.throwException 2014-05-19 17:02:18 +04:00
Andrey Breslav 8885d5709e Private inside a package should be visible only inside this package in the same module 2014-05-19 13:02:25 +04:00
Zack Grannan 42f186b33f Added String Concat -> Interpolation Intention (KT-4750) 2014-05-16 19:00:25 +04:00
Andrey Breslav 5ab979864b Temporarily revert changes that create separate class descriptors for each PSI class 2014-05-16 12:27:14 +04:00
Andrey Breslav 291741754b Guard loading top-level classes with a check that they are not Kotlin binaries 2014-05-14 17:15:01 +04:00
Andrey Breslav 64f0a8d420 Provide access to package fragments generated for static members of Java classes 2014-05-13 19:39:32 +04:00
Andrey Breslav 87750d633c JavaDescriptorResolver supports resolving classes by PSI elements, not by FqNames 2014-05-13 19:39:31 +04:00
Alexey Sedunov 5fc1725b33 Extract Function: Type parameters inference 2014-05-12 12:55:02 +04:00
Alexander Udalov c7277250d9 Use ReflectionTypes instead of KotlinBuiltIns in type checker 2014-05-08 16:45:15 +04:00
Valentin Kipyatkov 717977af61 No more java lookup elements in code completion (except for one case) 2014-05-07 22:50:21 +04:00
Alexander Udalov 42d167d17e Add missing copyrights across the project 2014-05-05 20:43:35 +04:00
Alexander Udalov b7746cbee7 Move module 'serialization' to core/ 2014-05-05 20:43:34 +04:00
Alexander Udalov 16daeb9544 Misc refactorings in KotlinBuiltIns
- delete fields which were supposed to be used for caching, but mistakenly were
  never used
- delete/inline unused methods and constants
- delete useless logic related to root package fragment: package fragment
  providers are only supposed to find packages they're aware of
2014-05-05 20:42:35 +04:00
Andrey Breslav 775c941f8a hasSynthesizedParameterNames() pulled up into CallableDescriptor 2014-04-30 16:30:17 +04:00
Svetlana Isakova 775606f80a Do not remove trivial substitutions
to avoid substituting a new type parameter by default instead of leaving the same
 #KT-4887 Fixed
2014-04-30 13:34:34 +04:00
Svetlana Isakova a57b4f6459 Render inferred and not inferred type parameters
while rendering a resolved call
2014-04-30 13:34:34 +04:00
Svetlana Isakova e59fa2083e Substituted special error type for not inferred parameter
Rendered it as T (of red color) in the renderer HTML_FOR_NOT_INFERRED_TYPE_PARAMETERS
 instead of '???' without information about type parameter
2014-04-30 13:34:32 +04:00
Andrey Breslav c6bd4a22ef Iterators replaced with streams where appropriate 2014-04-29 19:11:47 +04:00
Andrey Breslav 19719f9747 Deprecated _tmp functions replaced by library ones 2014-04-29 19:11:47 +04:00
Andrey Breslav 4181bcc319 JavaCallableMemberDescriptor.hasSynthesizedParameterNames() introduced 2014-04-29 19:11:47 +04:00
Alexander Udalov 61675de305 Optimize PropertyMetadataImpl instance creation
Create all property metadatas in <clinit> and save them to a static array
$propertyMetadata. Getter/setter of each delegated property will then just
obtain the corresponding instance from that array

 #KT-4232 Fixed
2014-04-24 16:10:15 +04:00
Alexander Udalov 6b348bfc6e Make Ref fields volatile
Otherwise local shared variables are not safe to use from several threads
2014-04-24 16:10:11 +04:00
Alexander Udalov af421f53da Rename FQNAMES -> FQ_NAMES 2014-04-24 16:10:11 +04:00
Andrey Breslav bb87a6bb59 Only create lazy annotations for descriptors from code 2014-04-18 21:28:21 +04:00
Nikolay Krasko 068c9636fc Refactoring: rename TEXT to FQNAMES_IN_TYPES 2014-04-18 13:25:58 +04:00
Alexander Udalov 4c973b79ee Get rid of poorly named NotInferredVisibilitySink
Also make TraceBasedErrorReporter invoke OverrideResolver to report "cannot
infer visibility", because there's some additional logic there
2014-04-17 19:51:31 +04:00
Alexander Udalov 34e7584aec Move some utilities from OverridingUtil to OverrideResolver
OverridingUtil will be present at runtime and we should strive to minimize the
size of our runtime classes

Also add a comment to getOverriddenDescriptors()
2014-04-17 19:51:30 +04:00
Alexander Udalov 3dffd428ad Refactor OverrideResolver and OverridingUtil
Fix warnings, simplify code. Untangle a very complex code related to
diagnostics on multiple default values and different names of parameters in
supertypes; fix a bug there, add test
2014-04-17 19:51:30 +04:00
Alexander Udalov 4f9f5d231b Fix incorrect diagnostic message for CONFLICTING_OVERLOADS
- the member and the container were mixed up
- don't output "defined in" part of the message, because we tell later where
  it's already defined in
- fix an instability of the diagnostic order in OverloadResolver by using
  LinkedHashSet
2014-04-17 19:51:29 +04:00
Alexander Udalov 4a60c59f39 Minor, fix KotlinSignature of DFS methods 2014-04-14 16:02:10 +04:00