Commit Graph

25028 Commits

Author SHA1 Message Date
Stanislav Erokhin 1d5cd8f7e1 Created LexicalWritableScope add added RedeclarationHandler for LexicalScopeImpl 2015-08-29 01:44:34 +03:00
Stanislav Erokhin 04ccb4cf90 Added hashCode & equals to LexicalToJetScopeAdapter for correct rewrite in trace 2015-08-29 01:44:34 +03:00
Alexander Udalov 7c28a2e732 Support KClass.defaultType 2015-08-28 21:22:11 +03:00
Alexander Udalov ea8fe56704 Include property type to KProperty.toString 2015-08-28 21:11:31 +03:00
Alexander Udalov d36ef90dd6 Provide equals/hashCode/toString for KParameter implementation
Two KParameter instances are equal iff their backing descriptors are equal and
their callables are equal
2015-08-28 21:11:30 +03:00
Alexander Udalov d4825cf4f0 Support KParameter.kind: instance, extension receiver, or value 2015-08-28 21:11:22 +03:00
Alexander Udalov a73d02418d Introduce additional API for introspecting functions
memberFunctions, declaredMemberFunctions, staticFunctions, etc.

 #KT-8797 Fixed
2015-08-28 21:11:21 +03:00
Alexander Udalov ebe4a8ec89 Provide equals/hashCode/toString for KType implementation 2015-08-28 21:11:20 +03:00
Alexander Udalov 9882e86ecb Don't render contents of enum entry classes in .txt tests, regenerate tests
They are irrelevant because cannot be accessed from the outside anyway
2015-08-28 21:11:06 +03:00
Alexander Udalov 29abf94327 Prohibit clone() for enum classes
#KT-8972 Fixed
2015-08-28 21:11:02 +03:00
Alexander Udalov 89f3cfc704 Support parameter names for Java 8 classes in reflection
Also support specifying additional options to javac in codegen tests, which was
needed to compile Java sources with the "-parameters" option
2015-08-28 21:11:01 +03:00
Alexander Udalov 30967baca8 Minor, rename extension property to avoid name clash 2015-08-28 21:11:00 +03:00
Denis Zharkov e8f91e596c Adjust test data after fixes about generic nullability 2015-08-28 18:50:26 +03:00
Denis Zharkov 4a3fbcc16e Make project compilable after fixes about generic nullability 2015-08-28 18:50:26 +03:00
Denis Zharkov 5e09a0c2c9 Add some test cases after review 2015-08-28 18:50:25 +03:00
Denis Zharkov 00a78fce0c Get rid of special logic when check receiver
Instead of manually checking nullability when reporing UNSAFE_CALL_ERROR
just check if receiver type is subtype of receiver parameter

Make it in two steps
1. Check subtype with respect to smart casts but ignoring nullability (if it's not satisfied -> ERROR)
2. Check subtype with respect to nullability and smartcasts (record latter if needed)
2015-08-28 18:50:25 +03:00
Denis Zharkov 6ed6b2e298 Move and expand hack about not-null smart casts for type parameters 2015-08-28 18:50:25 +03:00
Denis Zharkov acf6491eed Simplify getSmartCastVariantsExcludingReceiver
Use DataFlowValueFactory.createDataFlowValue instead of manual instanceof
2015-08-28 18:50:25 +03:00
Denis Zharkov 9f8f0e9d37 Fix DataFlowValue creation for Transient/Script receivers 2015-08-28 18:50:25 +03:00
Denis Zharkov b471767e03 Refine smart cast check for type parameters 2015-08-28 18:50:25 +03:00
Denis Zharkov aad977d204 Properly check whether nullability of receiver argument fits to parameter's nullability
It's should behave like we check isSubtype(receiverType, parameterType) + use nullability info from smart cast

 #KT-1090 Fixed
2015-08-28 18:50:25 +03:00
Denis Zharkov 70d4a7997e Minor. Extract getDataFlowValueExcludingReceiver 2015-08-28 18:50:25 +03:00
Denis Zharkov 6ecfa6e985 Refine subtyping check: pay attention to corresponding supertype nullability
F: Any, T : F? => !isSubtype(T, Any)

It helps to identify upper bounds violation like in KT-7455

 #KT-7455 Fixed
 #KT-2924 Fixed
 #KT-3015 Fixed
2015-08-28 18:50:25 +03:00
Denis Zharkov a906be6dd7 Prohibit using null as a value of generic type
#KT-7350 Fixed
 #KT-7736 Fixed
 #KT-7485 Fixed
2015-08-28 18:50:25 +03:00
Denis Zharkov dfac2205fd Use makeNullable when checking if initial constraints are satisfied
In most cases it should not matter what to use makeNotNullable or makeNullable.
But the first one breaks for this type of constraint:
T <: Any? (where T is type parameter with upper bound Any?)

Currently makeNotNullable(T) doesn't differs from T, in contrast to makeNotNullable(Any?)
So makeNotNullable(T) <: makeNotNullable(Any?) is not satisfied, but it's obvious that T <: Any?.
2015-08-28 18:50:24 +03:00
Ilya Gorbunov 83f9ee2737 Concurrent getOrPut for concurrent maps.
#KT-5800 Fixed
2015-08-28 17:51:48 +03:00
Dmitry Jemerov c7b26ed7ca improve support for renaming overriding methods in enum entries
#KT-8891 Fixed
2015-08-28 15:49:07 +02:00
Valentin Kipyatkov a012fd0c7d Minor changes after code review 2015-08-28 16:22:48 +03:00
Valentin Kipyatkov 02922f3f93 No parameter name&type completion for anonymous function 2015-08-28 16:22:48 +03:00
Valentin Kipyatkov bd4f1c65c2 Insert type arguments by Tab too 2015-08-28 16:22:47 +03:00
Valentin Kipyatkov 9df3bb8a06 More correct sorting of parameter name&type suggestions in completion 2015-08-28 16:22:47 +03:00
Valentin Kipyatkov 7ef9a9d6d4 Better presentation 2015-08-28 16:22:47 +03:00
Valentin Kipyatkov 2de5229098 Additional item inserting lambda provided by completion when all parameters before the last are optional 2015-08-28 16:22:47 +03:00
Valentin Kipyatkov dfe4f8e34f Renamed parameters + slightly more correct logic 2015-08-28 16:22:46 +03:00
Valentin Kipyatkov a4c5907a1f KT-8898 If invocation context contains functional value compatible with function in completion list, show non-literal item
#KT-8898 Fixed
2015-08-28 16:22:46 +03:00
Valentin Kipyatkov fbb37f0154 Refactored ReferenceVariantsHelper to allow specifying receiver 2015-08-28 16:22:46 +03:00
Valentin Kipyatkov 6dde70e358 Split LookupElementFactory into 3 classes 2015-08-28 16:22:45 +03:00
Valentin Kipyatkov cff817d03b Moved class 2015-08-28 16:22:45 +03:00
Valentin Kipyatkov 6e6e80cc2a Moved method 2015-08-28 16:22:45 +03:00
Valentin Kipyatkov 363295f6af Moved creation of additional items like special items for functions accepting lambda into LookupElementFactory to provide them in smart completion too 2015-08-28 16:22:44 +03:00
Valentin Kipyatkov 5b3e83d547 Deprecated method usage fix 2015-08-28 16:22:44 +03:00
Valentin Kipyatkov 66719923c2 KT-6050 Support completion for super qualifier
#KT-6050 Fixed
2015-08-28 16:22:44 +03:00
Valentin Kipyatkov 7458000f14 Use DescriptorToSourceUtilsIde because DescriptorToSourceUtils does not work for compiled Kotlin descriptors 2015-08-28 16:22:44 +03:00
Dmitry Jemerov 19eea4bf4e store cached Java file stub in the userdata of a JetFile (project specific), not of VirtualFile (app global) 2015-08-28 15:16:22 +02:00
Nikolay Krasko 1a47d6754d Allow to search marker classes in dumb mode (EA-67309) 2015-08-28 13:44:02 +03:00
Nikolay Krasko 4c9af37526 Can't navigate to SAM adapter function declaration (KT-8918)
#KT-8918 Fixed
2015-08-28 13:43:59 +03:00
Valentin Kipyatkov ab783e052f No override for private to this 2015-08-27 23:21:22 +03:00
Valentin Kipyatkov 4717b17418 Inspection & fix for redundant supertype qualification 2015-08-27 23:21:22 +03:00
Valentin Kipyatkov d62eeb1c25 Better test 2015-08-27 23:21:22 +03:00
Valentin Kipyatkov dcfe9b98d7 Fixed bug with duplicated members in Override Members dialog 2015-08-27 23:21:21 +03:00