Commit Graph

586 Commits

Author SHA1 Message Date
Pavel V. Talanov 06916d98c6 default -> companion: replace all mentions of default and default object 2015-03-17 15:47:39 +03:00
Pavel V. Talanov 2a6facaef6 default -> companion: default object -> class object in project code, builtins and libs code 2015-03-17 15:46:48 +03:00
Alexander Udalov 094fa2f92b Report error on using reflection without kotlin-reflect.jar in classpath
Should be a warning because strictly speaking, the codegen doesn't need it
during the compilation. It's an error at the moment only to let all clients of
Kotlin reflection know that they must include kotlin-reflect.jar in the
classpath
2015-03-16 20:40:49 +03:00
Alexander Udalov 8af6ca5279 Delete kotlin.jvm.internal.KObject
It was supposed to be used in reflection but the benefits do not outweigh the
cost of KT-6951

 #KT-3223 Fixed
 #KT-6951 Fixed
2015-03-12 23:15:38 +03:00
Andrey Breslav 36bbd2c0e3 ErrorReporter is now Java-independent 2015-03-11 19:38:15 +03:00
Andrey Breslav 61989ba245 KT-6815 Representing raw types when used as supertypes for Java classes
#KT-6815 Fixed
2015-03-11 18:27:37 +03:00
Andrey Breslav 7c62d8ed83 Minor. Unused declarations removed 2015-03-11 18:27:37 +03:00
Denis Zharkov 4022982760 Add synthetic argument to default constructors
It's need to add synthetic argument (of type that user can't use)
to constructors with default arguments to avoid clashing with
real user's constructor having the same set of parameters
and additional int's arguments.
2015-03-11 17:45:28 +03:00
Alexander Udalov 73e4287aee Initial support of annotation loading at runtime
In order to locate an annotated entity, we need to implement almost the whole
Java element model (which will be used anyway for Java descriptor loading)
2015-03-11 16:42:17 +03:00
Alexander Udalov 356f54b5df Initial support of descriptor loading at runtime 2015-03-11 16:42:15 +03:00
Pavel V. Talanov 9ecf95532e Replace 'class object' with default object in project code 2015-03-10 18:07:46 +03:00
Alexander Udalov ed022f892b Drop JavaTypeParameter#getIndex 2015-03-07 02:32:14 +03:00
Alexander Udalov ca8831097f Resolve annotations on Java constructors
Also add tests on custom annotations on fields and methods
2015-03-07 02:32:14 +03:00
Alexander Udalov e136025ac5 Show "kotlin.Any" in decompiled text for local/anonymous types 2015-03-07 02:30:28 +03:00
Pavel V. Talanov f72f548a93 Add ClassDescriptor#isDefaultObject()
with dummy implementations for now
2015-03-05 13:06:12 +03:00
Pavel V. Talanov 48fbce9582 Refactor: process mentions of class object
Rename usages that refer to "default object" concept now
Test data file names are left as is
2015-03-03 20:57:08 +03:00
Pavel V. Talanov 7f672f8078 Minor: remove redundant class objects from project code 2015-03-03 13:04:30 +03:00
Alexander Udalov b99b1883bc Drop unused parameter in JavaToKotlinClassMap and subclasses 2015-02-25 20:13:46 +03:00
Alexander Udalov fca7a8c4a2 Drop PrimitiveTypesUtil, store desc in JvmPrimitiveType 2015-02-25 20:13:46 +03:00
Alexander Udalov e705ff2517 Write KotlinSyntheticClass annotation on when-by-enum mapping classes 2015-02-16 21:46:22 +03:00
Alexander Udalov 6ce8d6bd2e Serialize descriptors for local/anonymous classes on JVM
Reflection needs this information to work for local classes and anonymous
objects
2015-02-16 21:46:21 +03:00
Alexander Udalov 0d05fca838 Support serialization/deserialization of local classes
Most of these changes are aimed to support and correctly transform ClassId for
local classes, no actual bytes are written or read at the moment (see next
commits). See the comment on ClassId for clarification.

A hack in DescriptorSerializer which erased anonymous types to Any (which had
been breaking the consistency between descriptors resolved from sources and
from serialized information) is now gone
2015-02-16 20:19:54 +03:00
Alexander Udalov add9bb34cb Refactor ReadKotlinClassHeaderAnnotationVisitor
Extract a hierarchy of four nested classes instead of anonymous
2015-02-16 20:19:53 +03:00
Alexander Udalov 5d8ae3ed6a Minor, refactor some constants in JvmAnnotationNames
Declare KotlinClass similarly to KotlinSyntheticClass, this will be used later
2015-02-16 20:19:52 +03:00
Alexander Udalov cd9898fc43 Minor, rename and invert meaning of ClassId.isTopLevelClass
Also use a simpler constructor and simplify ClassDeserializer.ClassKey
2015-02-16 20:19:50 +03:00
Alexander Udalov e812c4e67f Introduce KotlinSyntheticClass.Kind.LOCAL_TRAIT_IMPL 2015-02-16 20:19:50 +03:00
Pavel V. Talanov 32aff01969 Increase abi version 2015-02-16 15:38:48 +03:00
Pavel V. Talanov 766912c590 Generate additional deprecated "OBJECT$" field for class object
To avoid breaking some code for now
It should be removed later
2015-02-16 15:38:43 +03:00
Pavel V. Talanov f482768acf Introduce ClassDescriptor#getDefaultObjectDescriptor()
ClassDescriptor#getClassObjectDescriptor (with old semantics) is now a utility
Process usages and replace with calls to a new method where appropriate
2015-02-16 15:38:42 +03:00
Pavel V. Talanov 945072a129 Drop DeserializedResolverUtils and it's usages 2015-02-16 15:38:41 +03:00
Pavel V. Talanov 42d2b97c09 Remove all class object related constants and utils from JvmAbi 2015-02-16 15:38:30 +03:00
Pavel V. Talanov 0343fd8fc7 Rework class objects
Class objects have name "Default" by default
Do not produce synthetic class objects
Class objects have new semantics:
    class "A" has class object "B" if literal "A" can be used as a value of type "B"
Class objects act like ordinary nested objects
    i.e. are accessible from class scope via getClassifier()
Jvm backend: class object fields and class have the name of class object ("Default")
	as opposed to special "OBJECT$" and "object"
Serialization: only the name of class object is needed to serialize data
2015-02-16 15:38:27 +03:00
Alexander Udalov 9f74d64d03 Avoid using FQNAME_TO_CLASS_DESCRIPTOR slice where module exists 2015-02-11 18:37:13 +03:00
Andrey Breslav 1d4109aec1 Retaining annotations on Java array types 2015-02-10 06:55:48 +01:00
Andrey Breslav 5db6bb04e3 Basic Java nullability warnings implemented
#KT-6723 In Progress
2015-02-10 06:55:47 +01:00
Alexander Udalov 4128655893 Report incomplete hierarchy error
This is the case when you reference a Java class in Kotlin whose superclass is
not resolved. Previously this fact was swallowed by LazyJavaClassDescriptor
leading to mysterious compilation errors

 #KT-5129 Fixed
2015-02-09 21:14:02 +03:00
Alexander Udalov cafc1ea24d Fix resolution of inherited Kotlin properties in Java classes
#KT-6720 Fixed
2015-02-04 14:57:47 +03:00
Michael Nedzelsky df8fed096c add support for compile time constant serialization 2015-02-03 14:41:24 +03:00
Andrey Breslav da639039bd KT-6698 Bad class file when using a star-projection on a Java's recursive generic parameter
#KT-6698 Fixed
2015-02-02 19:52:00 +03:00
Alexander Udalov 5903b8c4a7 Reorder and optimize dependencies between modules and libraries
- drop 'kotlin-runtime' and other dependencies which are exported by
  other modules ('util' and 'util.runtime' in case of 'kotlin-runtime')
- make all Kotlin modules from the compiler depend on 'util' for clarity
- put 'util' and 'util.runtime' to the bottom of the list everywhere: when
  kotlin-runtime gets reflection, classes from core/ should have higher
  priority than their previous versions from kotlin-runtime.jar
2015-01-28 19:58:35 +03:00
Valentin Kipyatkov 974982463c Visible classes take priority when resolving imports with * 2015-01-21 20:10:18 +03:00
Valentin Kipyatkov b9d47ffe7a Changed priority for default imports + default imports include all built-ins explicitly for java module
#KT-4374 Fixed
2015-01-21 20:10:18 +03:00
Alexey Tsvetkov 89f8442705 Fixed weird compilation issue by moving function to other package 2015-01-14 21:49:52 +03:00
Alexander Udalov 64c6055030 Rename jet -> kotlin in frontend, descriptors: resolve
org.jetbrains.jet.lang.resolve -> org.jetbrains.kotlin.resolve
2015-01-11 05:09:01 +03:00
Alexander Udalov 8affc31303 Rename jet -> kotlin in descriptor.loader.java, frontend.java
Split package 'lang/resolve/java' into two semantically different packages:
'resolve/jvm' and 'load/java'. Also rename 'lang/resolve/kotlin' to
'load/kotlin'
2015-01-11 05:08:57 +03:00
Alexander Udalov 524fdc2527 Rename jet -> kotlin in descriptors, types, names
org.jetbrains.jet.lang.descriptors -> org.jetbrains.kotlin.descriptors
org.jetbrains.jet.lang.types -> org.jetbrains.kotlin.types
org.jetbrains.jet.lang.resolve.name -> org.jetbrains.kotlin.name
2015-01-10 15:52:20 +03:00
Alexander Udalov 2ac4c65720 Move PlatformToKotlinClassMap to org.jetbrains.kotlin.platform
Also JavaToKotlinClassMap
2015-01-10 15:52:17 +03:00
Alexander Udalov e88f89d1c6 Rename jet -> kotlin in descriptors: built-ins
org.jetbrains.jet.lang.types.lang -> org.jetbrains.kotlin.builtins
2015-01-10 15:52:16 +03:00
Alexander Udalov 2c414d880c Rename jet -> kotlin in descriptors: renderer
org.jetbrains.jet.renderer -> org.jetbrains.kotlin.renderer
2015-01-10 15:51:59 +03:00
Alexander Udalov 05eaf81ba6 Rename jet -> kotlin and regroup files in serialization
org.jetbrains.jet.descriptors.serialization ->
org.jetbrains.kotlin.serialization

Deserialization goes to subpackage deserialization, built-ins-related stuff
goes to subpackage builtins
2015-01-09 16:37:22 +03:00