Valentin Kipyatkov
4c0404ea82
Changes on code review
2015-08-04 18:05:57 +03:00
Valentin Kipyatkov
c3064e2b0f
Synthetic extensions for non-public get/set java methods
2015-08-04 18:05:56 +03:00
Valentin Kipyatkov
d5f95cf126
Correct visibility for non-public SAM-adapters
2015-08-04 18:05:56 +03:00
Valentin Kipyatkov
cb9ef9e1f0
Fixed nullability for return and parameter types in SAM-adapters
2015-08-04 18:05:56 +03:00
Valentin Kipyatkov
729085ec9a
Iniital implementation of synthetic extensions for SAM-adapter functions (non-static only)
2015-08-04 18:05:55 +03:00
Mikhail Glukhikh
992c019c1e
Redundant modifier targets introduced (abstract / open on interface, final on enum or object)
2015-08-03 19:42:00 +03:00
Mikhail Glukhikh
d127162a6d
Removed LOCAL_ENUM_NOT_ALLOWED
2015-08-03 19:41:58 +03:00
Mikhail Glukhikh
4bd48c4796
Regular modifier checker implemented (initial version). A set of tests fixed accordingly.
...
Most of modifier diagnostic is expressed by REDUNDANT_MODIFIER, INCOMPATIBLE_MODIFIERS, REPEATED_MODIFIER, WRONG_MODIFIER_TARGET, WRONG_MODIFIER_PARENT.
A set of modifier diagnostics is not in use now (but not deleted yet).
2015-08-03 19:41:50 +03:00
Mikhail Glukhikh
faac06ff7e
Annotation option 'mustBeDocumented': definition, mapping from Kotlin to Java Documented and back, tests
2015-08-03 19:41:48 +03:00
Mikhail Glukhikh
dfaed3fef3
Binary or runtime repeatable annotations are not allowed for JVM. Some tests fixed accordingly.
2015-08-03 19:41:45 +03:00
Denis Zharkov
6b92f67eac
Load raw types as platform with specific bounds
...
Raw(A<T_i>) = (A<UP(T_i)>..A<*>)
Raw types have specific scopes that behaves like JVM signature erasure
2015-07-31 17:33:21 +03:00
Denis Zharkov
0fba28a8f0
Do not retrieve parent of FQname for root
...
#KT-8642 Fixed
2015-07-31 17:33:20 +03:00
Dmitry Petrov
9bf0211152
KT-8408 Prohibit Array<T>::class for non-reified T
2015-07-30 12:18:29 +03:00
Alexander Udalov
50dbda1e1a
Introduce KClass.members, make properties/extensionProperties extensions
...
To avoid significant growth of KClass and KPackage interfaces
2015-07-29 21:36:36 +03:00
Mikhail Glukhikh
41500c916b
java Retention + Repeatable = kotlin.annotation.annotation (but java Repeatable is still intact), a few tests
2015-07-29 16:28:36 +03:00
Mikhail Glukhikh
10ba9c7264
Repeatable test renamed
2015-07-29 16:28:33 +03:00
Mikhail Glukhikh
a072550931
Class is an annotation iff it is annotated by kotlin.annotation.annotation, or is kotlin.annotation.annotation itself.
...
JetClassOrObject.isAnnotation() is no more in use during resolve. Additional test.
2015-07-29 16:28:26 +03:00
Mikhail Glukhikh
dbf6da89b7
java.lang.annotation.Repeatable is deprecated + test in a new group: diagnostic tests with Java 8.
2015-07-28 19:03:55 +03:00
Mikhail Glukhikh
a86857fbb5
Java Deprecated is mapped in accordance with Java Target / Retention, some diagnostic changed
2015-07-28 17:13:37 +03:00
Mikhail Glukhikh
d6406d8d4a
Annotation repetition checking with a pair of tests, some old tests changes
2015-07-28 17:13:32 +03:00
Mikhail Glukhikh
11f87e6ca1
No more java Target / Retention loaded. Render java Retention / Target. Related test changes.
2015-07-22 19:00:39 +03:00
Mikhail Glukhikh
c2480d1183
Java to Kotlin annotation retention mapping + new test + JvmLoader test adaptation
2015-07-22 19:00:26 +03:00
Pavel V. Talanov
add8387141
Fix some problems with jsCode function
...
1. Fix a bug in frontend when passing non-String constant led to exception
2. Fix a bug in backend when passing non-JetStringTeplate string constant led to exception
3. Avoid recomputing constant argument in backend
2015-07-21 20:52:42 +03:00
Dmitry Petrov
6437a4bdc6
Support overload ambiguity resolution for callable references by expected type.
...
Resolve callable references taking into account expected callable types.
This affects call resolution procedure (resolve 'foo' in for 'foo(::bar)') similar to the approach used for function literals:
* During "shape arguments" phase of call resolution, callable references are resolved in independent context without expected type. If the callable reference is ambiguous, its shape type is a function placeholder type without parameter types and return type information. Otherwise, it is a reflection type for the resolved function or property. Upper-level call is resolved without taking into account ambiguous callable references.
* During "complete call" phase of call resolution, resolve callable reference arguments to actual descriptors (if possible), and update constraint system for the given call accordingly.
#KT-6982 Fixed
#KT-5780 Fixed
2015-07-21 18:33:15 +03:00
Mikhail Glukhikh
94a00540be
Targeting / retention for a set of standard annotations, some inapplicable annotation checks replaced with target check, some fixed tests
2015-07-21 15:36:53 +03:00
Mikhail Glukhikh
9e7a67fabf
Warning about java.lang.annotation.Target annotation usage
2015-07-21 15:20:37 +03:00
Mikhail Glukhikh
1309c1f95f
Annotation mapper is introduced to map java annotation targets to kotlin targets + a set of new / fixed tests
2015-07-21 15:20:31 +03:00
Denis Zharkov
58e7923218
Use substituted return type for SAM adapeter of constructor
...
#KT-7282 Fixed
2015-07-21 15:16:06 +03:00
Denis Zharkov
97af85da9c
Change default upper bound of Java type parameters to Any!
...
#KT-7672 Fixed
2015-07-21 15:16:05 +03:00
Valentin Kipyatkov
4ec26de2a8
Changes on code review
2015-07-21 08:32:51 +03:00
Valentin Kipyatkov
31b7c33fa8
No need to scan base classes
2015-07-21 08:32:51 +03:00
Valentin Kipyatkov
1c52f8a524
Fixed synthetic properties for method inherited from two bases
2015-07-21 08:32:51 +03:00
Valentin Kipyatkov
612c009f6b
Synthetic properties: correct behaviour for method hierarchies
2015-07-21 08:32:51 +03:00
Valentin Kipyatkov
367e294452
No synthetic properties in java class for methods inherited from Kotlin
2015-07-21 08:32:50 +03:00
Valentin Kipyatkov
d2fb7381ce
Tested one more case
2015-07-21 08:32:50 +03:00
Valentin Kipyatkov
4a8adacedd
Changed policy for properties from methods like "getURL()""
2015-07-21 08:32:50 +03:00
Valentin Kipyatkov
23cfe88b71
KT-8530 Synthetic properties doesn't work with smart casts
...
#KT-8530 Fixed
2015-07-21 08:32:50 +03:00
Valentin Kipyatkov
b6027a0efe
Changed synthetic properties naming for getters starting with "is"
2015-07-21 08:32:49 +03:00
Nikolay Krasko
9648338b19
Enum with interface keywords leads to fail in DeclarationChecker
2015-07-17 20:59:03 +03:00
Nikolay Krasko
71b406d792
Fix class kind detector: prioritize enum over annotations. Introduce new error about enum annotations classes.
2015-07-17 20:59:02 +03:00
Mikhail Glukhikh
af5e7f58da
Implementation of Kotlin's 'target' annotation mapping to Java's 'Target' annotation + tests
2015-07-17 12:05:27 +03:00
Mikhail Glukhikh
2a1058ed63
Some usages of JetClassOrObject.isAnnotation() are removed. Related test fixed.
2015-07-17 12:05:19 +03:00
Mikhail Glukhikh
7f12965741
Suppress test corrected
2015-07-17 12:05:15 +03:00
Valentin Kipyatkov
28e9fbf9b8
Correct synthetic extensions for methods like "getURL"
2015-07-16 13:49:18 +03:00
Valentin Kipyatkov
22e631dda3
Naming with "is" supported for synthetic extensions
2015-07-16 13:49:18 +03:00
Valentin Kipyatkov
2ec6f50402
Set method should not accept vararg
2015-07-16 13:49:15 +03:00
Valentin Kipyatkov
82f1eafa0b
No synthetic properties of type Unit
2015-07-16 13:49:15 +03:00
Valentin Kipyatkov
2e351f3e4d
Initial implementation of synthetic extensions resolve
2015-07-16 13:49:13 +03:00
Pavel V. Talanov
c313887641
Split CompileTimeConstant into two entities
...
1. ConstantValue
* just holds some value and its type
* implementations for concrete constants
2. CompileTimeConstant
* is only produced by ConstantExpressionEvaluator
* has additional flags (canBeUsedInAnnotation etc)
* has two implementations TypedCompileTimeConstant containing a constant value
and IntegerValueConstant which does not have exact type
* can be converted to ConstantValue
Adjustt usages to use ConstantValue if flags are not needed
Add tests for some uncovered cases
2015-07-16 02:28:05 +03:00
Denis Zharkov
e23c7f457b
Preserve type annotations on type parameter when substituting
...
Subsitute(@A T, T:@B String) = @B @A String
Nullability when loading Java:
Subsitute(@NotNull T, T:String) = @NotNull String
Subsitute(@NotNull T, T:String!) = @NotNull String
Subsitute(@NotNull T, T:String?) = @NotNull String
Subsitute(@Nullable T, T:String) = @Nullable String?
Subsitute(@Nullable T, T:String!) = @Nullable String?
Subsitute(@Nullable T, T:String?) = @Nullable String?
2015-07-15 10:01:14 +03:00