Commit Graph

25013 Commits

Author SHA1 Message Date
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
Valentin Kipyatkov ccfa48b564 MInor 2015-08-27 23:21:21 +03:00
Valentin Kipyatkov 40638de67c Override members does not generate qualified super when not needed 2015-08-27 23:21:21 +03:00
Valentin Kipyatkov dd6702b832 Minor 2015-08-27 23:21:21 +03:00
Valentin Kipyatkov 9497856d8e KT-8868 "Implement members" generates unqualified reference for member class/interface
#KT-8868 Fixed
2015-08-27 23:21:21 +03:00
Valentin Kipyatkov 14763a7ffa Renames 2015-08-27 23:21:21 +03:00
Valentin Kipyatkov ba33c834c1 Add name to argument intention to work not only on the last argument 2015-08-27 23:21:20 +03:00
Dmitry Jemerov 5e1d8bc503 test for safe delete of data class parameter used as componentN() function in Kotlin code 2015-08-27 21:15:48 +02:00
Dmitry Jemerov 63d477e355 fix broken merge; support for renaming primary constructor parameter which declares an overridden property 2015-08-27 21:15:47 +02:00
Dmitry Jemerov 3e5c687e9d additional tests to verify that cases from KT-4793 are fixed
#KT-4793 Fixed
2015-08-27 21:15:47 +02:00
Dmitry Jemerov ef4b32db0d fix find usages and rename for primary constructor properties
#KT-8807 Fixed
2015-08-27 21:15:46 +02:00
Yan Zhulanow 0c87639514 Fix annotation list parsing: @identifier:[a b c] 2015-08-27 18:16:06 +03:00
Nikolay Krasko 440379dfad Add univeral targets for idea_continuous that can work not only in JB local network 2015-08-27 15:51:57 +03:00
Nikolay Krasko 53db747a55 Use local mirror for getting idea artifacts 2015-08-27 15:51:56 +03:00
Nikolay Krasko 75396ff7bb Remove deprecated targets 2015-08-27 15:51:55 +03:00
Nikolay Krasko a2f30f9619 Add simple pattern pre-check in hasMetadata() 2015-08-27 15:49:18 +03:00