Commit Graph

28 Commits

Author SHA1 Message Date
Ilya Gorbunov
e4ab3f3b93 Fix rendered descriptors in test data after enhancing signatures. 2016-12-08 20:34:59 +03:00
Denis Zharkov
891a036b59 Change resolution priority level for SAM adapters
After this change SAM adapters are being resolved in the same group
as members, thus their overload resolution happens simultaneously.

But in the case of overload resolution ambiguity try to filter out all
synthetic members and run the process again.

See the issue and new test for clarification

 #KT-11128 In Progress
2016-12-07 21:04:44 +03:00
Ilya Gorbunov
2a7717214b Annotate new API with @SinceKotlin in kotlin-runtime except reflection and type aliases. 2016-10-13 08:37:31 +03:00
Valentin Kipyatkov
ec51076355 DescriptorRenderer to render annotations for all types + separate option to render annotation arguments + use it in IdeDescriptorRenderers 2016-10-11 23:38:54 +03:00
Ilya Gorbunov
16a0c55c6c Since 'printStackTrace' now fallbacks to the extension in stdlib, change the test expecting it to be deprecated due to language-version 1.0 accordingly. 2016-10-11 16:46:14 +03:00
Denis Zharkov
5381c06936 Improve 1.0-compatibility mode for JDK dependent members
Just reporting error by call checker may be too restrictive
in case there are some extensions that can be used successfully

Solution is to annotate additional members with
@Deprecated(level=Error) + @kotlin.internal.LowPriorityInOverloadResolution
2016-09-22 15:40:37 +03:00
Denis Zharkov
4431c6ad02 Fix inference when captured type is used as a lambda parameter type
Use lower approximation bound to obtain acceptable types for lambda parameters
those types depend on captured type

 #KT-12238 Fixed
 #KT-10627 Fixed
2016-09-21 18:05:26 +03:00
Denis Zharkov
fc5217f7fc Fix signature clash problems caused by special built-ins
Do not treat members with already changed signature as a reason
to create a hidden copy

See tests for clarification:
- There are `charAt` method in B that has different name in Kotlin - `get`,
  i.e. relevant descriptor has initialSignatureDescriptor != null
- When collecting methods from supertypes, `charAt` from A is also get
  transformed to `get`
- So it has effectively the same signature as B.get (already declared)
- If by an accident B.get had been declared with Kotlin signature
  we would have add A.charAt (after transformation) with special flag:
  HiddenToOvercomeSignatureClash (hides it from resolution)
- But here B.charAt was artificially changed to `get`, so no signature clash
  actually happened

 #KT-13730 Fixed
2016-09-09 16:33:32 +03:00
Denis Zharkov
915e36cb02 Add Map.getOrDefault method as PlatformDependent declaration with refined signature
- First parameter should have type of K instead of Any
- Special bridge should return second parameter if a key has wrong type
- Special bridge may throw an exception if defaultValue has wrong type

 #KT-13209 Fixed
2016-07-27 18:46:13 +03:00
Denis Zharkov
92bd6880da Add AdditionalBuiltInsMembers language feature and relevant checks 2016-06-09 17:57:15 +03:00
Denis Zharkov
e90c92f8d3 Separate additional built-in members from JDK into three groups
- White list: can be used as common built-in declaration
- Black list: can be used only for overrides and super-calls-
- Not considered members: ones that is not in black or white list.
Such members can be used in any context, but they usages marked as deprecated

Third kind is needed to make possible use declarations added in future JDK versions.
Deprecation is necessary because they may get into black list in next Kotlin compiler version
2016-05-16 15:38:13 +03:00
Denis Zharkov
d259b91143 Add MutableMap.remove(K, V) as built-in declaration
Use PlatformDependent annotation to guarantee it's only be available for JDK8
Also adjust type-safe bridges and mutable collection stubs generation
2016-04-29 15:08:54 +03:00
Denis Zharkov
55c4f875c8 Use signatures instead of fq-names in special built-ins
It's necessary to distinguish overloads,
e.g. MutableMap.remove now has two versions
2016-04-29 15:08:54 +03:00
Denis Zharkov
9bf2538e4c Introduce predefined enhancement info
It can be used to specify enhanced signature for standard JDK methods
without them be actually annotated

 #KT-9194 In Progress
 #KT-5175 In Progress
 #KT-10370 In Progress
 #KT-7127 In Progress
2016-04-25 17:41:08 +03:00
Denis Zharkov
5bc5722051 Load additional JDK functions into built-ins member scope
#KT-5990 Fixed
 #KT-7127 Fixed
 #KT-10370 Fixed
2016-04-25 17:41:08 +03:00
Mikhail Glukhikh
4501836b33 Java 8 tests fixed (txt only) 2015-10-20 11:18:38 +03:00
Alexey Tsvetkov
dc27363452 Remove @annotation from test data 2015-10-19 20:45:01 +03:00
Yan Zhulanow
3a89c2194a Fix Java 8 tests (annotation methods are not loaded as functions anymore) 2015-10-19 03:56:15 +03:00
Zalim Bashorov
79d38a6c8f Report the error when a declaration in Kotlin accidentally overrides a static member from Java 2015-10-16 16:14:34 +03:00
Zalim Bashorov
ae2831338b Load Java static members from parents 2015-10-08 19:33:29 +03:00
Denis Zharkov
4850fd10f0 Regenerate test data containing rendered descriptors
Introduced '@' after each annotation
2015-09-18 10:14:39 +03:00
Denis Zharkov
dbaf01feed Minor. Add '@' symbol in testData where necessary (fix Java 8 build) 2015-09-08 19:03:49 +03:00
Michael Nedzelsky
4b9ee88b9a fix tests for java 8 2015-09-08 02:06:05 +03:00
Mikhail Glukhikh
778ac7f25c annotation --> Retention / Repeatable / MustBeDocumented: converting from Java to Kotlin and back.
At this very short moment Kotlin supports both annotation(retention, repeatable, mustBeDocumented) and Retention / Repeatable / MustBeDocumented separately.
2015-09-04 12:49:36 +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
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
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