Commit Graph

25048 Commits

Author SHA1 Message Date
Dmitry Jemerov e283dbb8f4 when renaming a companion object, filter out references to companion object via its containing class, which shouldn't be updated by the rename 2015-08-31 12:08:13 +02:00
Dmitry Jemerov e99316d22e rename tests: defaultObject -> companionObject 2015-08-31 12:08:12 +02:00
Dmitry Jemerov 039738a995 consider a companion object to be used if it contains any members 2015-08-31 12:08:05 +02:00
Dmitry Jemerov c645b9c237 RenameKotlinClassProcessor: J2K 2015-08-31 12:08:04 +02:00
Dmitry Jemerov 3437891848 RenameJetClassProcessor: rename to .kt 2015-08-31 12:08:03 +02:00
Dmitry Jemerov 1f170e48e7 use references search for unused symbol inspection 2015-08-31 12:08:02 +02:00
Alexander Udalov fb09c91714 Minor, rename PlatformStatic* -> JvmStatic* in reflection 2015-08-29 18:42:09 +03:00
Alexander Udalov 408a86c761 Minor, add toString() for easier debug 2015-08-29 18:37:42 +03:00
Alexander Udalov a1097f7081 Add val KClass.staticProperties: Collection<KProperty0<*>>
To get static fields from Java classes
2015-08-29 18:37:41 +03:00
Alexander Udalov 593937d302 Support KCallable.callBy with map of parameters to arguments
callBy is able to handle optional parameters.

 #KT-8827 Fixed
2015-08-29 18:37:40 +03:00
Alexander Udalov 0d62680f63 Support KParameter.isOptional
#KT-8825 Fixed
2015-08-29 18:37:39 +03:00
Alexander Udalov fd97383f8a Fix mapping of jvmStatic functions
#KT-8800 Fixed
2015-08-29 18:37:38 +03:00
Alexander Udalov 9a8cf23ed4 Support KClass.companionObject and companionObjectInstance
#KT-7636 Fixed
2015-08-29 18:37:32 +03:00
Alexander Udalov 94d45f35d4 Support KClass.nestedClasses 2015-08-29 17:59:45 +03:00
Valentin Kipyatkov e8dc9ede31 Implemented HiddenDeclaration annotation (doc-comment to be added!) 2015-08-29 10:54:59 +03:00
Stanislav Erokhin ba4fb3e37c Add hack for Repl 2015-08-29 01:46:00 +03:00
Stanislav Erokhin 2cb3842c39 Take snapshot for LexicalWritableScope when subscopes created 2015-08-29 01:45:59 +03:00
Stanislav Erokhin 4c7bafce45 Global replace JetScope to LexicalScope 2015-08-29 01:45:56 +03:00
Stanislav Erokhin 1b1fae8899 Minor. Added some util methods for LexicalScope 2015-08-29 01:44:36 +03:00
Stanislav Erokhin d1efadf168 Created slice key LEXICAL_SCOPE 2015-08-29 01:44:35 +03:00
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