Commit Graph

32735 Commits

Author SHA1 Message Date
Alexander Udalov 2fcd4e955a Simplify code in callable reference resolution 2016-07-22 11:05:19 +03:00
Alexander Udalov 00f1415ed7 Fix "rewrite at slice LEXICAL_SCOPE" during callable reference resolution
Following the TODO in CallableReferencesResolutionUtils.kt, delete the
suspicious scope and use the new resolution process with the qualifier which
was obtained after the resolution of LHS. However, by default the tower
resolution algorithm also considers each qualifier as a class value as well,
which would be wrong here because resolution of LHS as a "value" happens
earlier in DoubleColonExpressionResolver and with slightly different rules. To
avoid that, do not mix in the "explicit receiver" scope tower processor when
creating processors for callable reference resolution.

Also delete unused functions and classes related to deleted scope, refactor
Scopes.kt

 #KT-8596 Fixed
2016-07-22 11:05:19 +03:00
Alexander Udalov 7b59864ed9 Refine double colon LHS resolution if expression is an object 2016-07-22 11:05:19 +03:00
Alexander Udalov 5a6237b357 Refactor resolution of double colon expression LHS
Try resolving the LHS only when it looks (PSI-wise) like it could represent a
type element. This, for example, allows "illegal selector" error to be reported
on weird expressions like '""?.""::class'.

Also remove expression text from the "illegal selector" diagnostic, it's not
needed and can screw up the error message if the text is too big
2016-07-22 11:05:19 +03:00
Mikhail Glukhikh 5a2f34b351 Deduct x != null from x?.y is NotNullType 2016-07-21 21:15:34 +03:00
Mikhail Glukhikh 90c6868f9b renderDataFlowValue() moved to test from completion 2016-07-21 21:15:31 +03:00
Mikhail Glukhikh edeef90c4b Minor improvements in DataFlowValue / IdentifierInfo 2016-07-21 21:15:27 +03:00
Mikhail Glukhikh 11f50186fa x?.y != null and x?.call() != null provoke now x != null, a set of tests #KT-2127 Fixed 2016-07-21 21:15:19 +03:00
Mikhail Glukhikh 9001b9bcc0 DataFlowValue & DataFlowValueFactory major refactoring, get rid of DataFlowValue.id : Any?
Instead, DataFlowValue now requires IdentifierInfo implementation to be created
DataFlowValue is compared using IdentifierInfo
2016-07-21 21:15:05 +03:00
Mikhail Glukhikh 7f9b9ddb45 DataFlowValueFactory: converted to Kotlin 2016-07-21 20:19:44 +03:00
Mikhail Glukhikh b1a2a0723c DataFlowValueFactory.java --> DataFlowValueFactory.kt 2016-07-21 20:19:41 +03:00
Mikhail Glukhikh 17a2a971c4 A pair of "Suppress" changed from CAST_NEVER_SUCCEEDS to UNCHECKED_CAST
(cherry picked from commit 2ac8a66)
2016-07-21 20:16:15 +03:00
Mikhail Glukhikh dbbc4ec281 Array<Subtype> can be now cast to Array<Supertype(?)> without CAST_NEVER_SUCCEEDS #KT-6391 Fixed
(cherry picked from commit 2629d55)
2016-07-21 20:16:06 +03:00
Mikhail Glukhikh 90e5e561e3 KT-6391: Arrays with same erased types counted as cast-compatible now
(cherry picked from commit 9e6f4bf)
2016-07-21 20:15:55 +03:00
Mikhail Glukhikh 82e69d9587 Remove setter parameter type inspection #KT-5771 Fixed
(cherry picked from commit 731a670)
2016-07-21 20:15:44 +03:00
Michael Bogdanov 1d5924d236 'superConstructorCall' test folder moved under 'innerNested' 2016-07-21 19:10:42 +03:00
Michael Bogdanov 55382ba848 Removed obsolete code in 'lookupConstructorExpressionsInClosureIfPresent' method 2016-07-21 19:10:42 +03:00
Michael Bogdanov 5dca4dbc67 Fix for KT-11833: Error generating constructors of class null with kind IMPLEMENTATION on anonymous object inheriting from nested class of super class
#KT-11833 Fixed
2016-07-21 19:10:42 +03:00
Stanislav Erokhin 6556cde329 Introduce new type checker. 2016-07-21 16:07:16 +03:00
Stanislav Erokhin d4d98c87ee Minor. fixed equals for TypeProjection.
Note: unclear where this equals is used.
2016-07-21 16:07:15 +03:00
Stanislav Erokhin 663752f086 Create error supertype instead of non-checked supertypes to avoid cyclic hierarchy in subtyping. 2016-07-21 16:07:15 +03:00
Stanislav Erokhin ebe9e6db37 Type constructors with different counts of type parameters are not equal from now. 2016-07-21 16:07:14 +03:00
Stanislav Erokhin 8193032ffb Refactoring. Separate KotlinTypeChecker to interface & Impl class. 2016-07-21 16:07:14 +03:00
Alexander Udalov 2c08796c45 Report ABI version incompatibility error always, not only if there are other errors
This is a radical but likely temporary measure to forbid the current compiler
from compiling code against binaries compiled by newer compilers

Cherry picked from commit 149a4eddff0106bbe91c9a6b51a26c12c242d14f and commit
285b20e3ff387eb3d2ee33ceaa376ed8eba90857
2016-07-21 15:03:52 +03:00
Alexey Tsvetkov ddc9369299 Update changelog for 1.0.4 2016-07-21 15:02:10 +03:00
Alexey Tsvetkov 5e4724a3b5 Update changelog for 1.0.4 2016-07-20 22:44:13 +03:00
Alexey Sedunov e232905614 Fix compilation 2016-07-20 17:01:07 +03:00
Michael Bogdanov 6da97027cc 'getSuperCallLabelTarget' refactoring 2016-07-20 16:50:50 +03:00
Michael Bogdanov 6f41e3b462 Fix for KT-11634: UOE in ConstructorContext.getOuterExpression for super call in delegation
#KT-11634 Fixed
2016-07-20 16:50:49 +03:00
Alexey Sedunov ae06f01c95 Create from Usage: Approximate unresolvable types
#KT-7722 Fixed
(cherry picked from commit 917cd22)
2016-07-20 16:36:12 +03:00
Alexey Sedunov a1e86e8bfa Create from Usage: Show target class name in the text of "Create member" quick fix
(cherry picked from commit a51d3fc)
2016-07-20 15:39:19 +03:00
Alexey Sedunov 82bdd1e42b Minor: Convert CallablePlacement to sealed class
(cherry picked from commit 47073b5)
2016-07-20 15:39:16 +03:00
Alexey Sedunov e1f58c554d Rename: Fix exception on property rename preview
(cherry picked from commit 7b54ad0)
2016-07-20 15:39:15 +03:00
Alexey Sedunov 1a13c21377 Create from Usage: Show receiver type in the text of "Create extension" quick fix
(cherry picked from commit c0d5df1)
2016-07-20 15:39:13 +03:00
Alexey Sedunov 79f73d3cc2 Minor: Fix compilation
(cherry picked from commit 5397e11)
2016-07-20 15:39:11 +03:00
Alexey Sedunov 2abcd17713 Create from Usage: Support "Create member/extension" corresponding to the extension receiver of enclosing function
#KT-10668 Fixed
(cherry picked from commit bc4c013)
2016-07-20 15:39:09 +03:00
Alexey Sedunov 49b6811b44 Create from Usage: Support "Create abstract function/property" inside an abstract class
#KT-7492 Fixed
(cherry picked from commit 75f6b7f)
2016-07-20 15:39:07 +03:00
Alexey Sedunov 3ba776fffa Code Insight: Format generated declarations
#KT-11176 Fixed
(cherry picked from commit 3641ad6)
2016-07-20 15:39:05 +03:00
Alexey Sedunov a33f946c14 Override/Implement Members: Implement Members: Fix base member detection when abstract and non-abstract members with matching signatures are inherited from an interface
#KT-11115 Fixed
(cherry picked from commit a3a2e57)
2016-07-20 15:39:01 +03:00
Alexey Sedunov dd7bd2b869 Inline Property: Support "Do not show this dialog" and "Inline this occurrence" options
#KT-12017 Fixed
(cherry picked from commit b53d8da)
2016-07-20 15:30:14 +03:00
Alexey Sedunov 59f37a8291 Introduce Property: Do not skip outer classes if extractable expression is contained in object literal. Skip outer classes of non-inner class
#KT-12084 Fixed
(cherry picked from commit 2852f44)
2016-07-20 15:30:12 +03:00
Alexey Sedunov 00ad37b769 Introduce Property: Fix extraction of expressions referring to primary constructor parameters
#KT-12294 Fixed
(cherry picked from commit 78212a4)
2016-07-20 15:30:10 +03:00
Alexey Sedunov c075d27731 Change Signature: Consider default value context an initial type context. Use parameter list as a type context for bodyless function
#KT-12413 Fixed
(cherry picked from commit f417b05)
2016-07-20 15:30:09 +03:00
Alexey Sedunov 57bc0d6734 Change Signature: Consider super call a by-name propagation site if either its class, or its primary constructor is a propagation target.
This fixes testJavaConstructorParameterPropagation test flickering
2016-07-20 15:30:07 +03:00
Alexey Sedunov 130e4fb745 Introduce Type Alias
#KT-12902 Fixed
2016-07-20 11:46:59 +03:00
Alexey Sedunov ce0e5b4b46 Convert to Kotlin: AbstractParameterTablePanel.java 2016-07-20 11:46:58 +03:00
Alexey Sedunov 27773fbe99 Convert to Kotlin: AbstractParameterTablePanel.java (rename to .kt) 2016-07-20 11:46:57 +03:00
Alexey Sedunov 3d49b27269 Convert to Kotlin: ExtractFunctionParameterTablePanel.java 2016-07-20 11:46:57 +03:00
Alexey Sedunov abe7b8c513 Convert to Kotlin: ExtractFunctionParameterTablePanel.java (rename to .kt) 2016-07-20 11:46:56 +03:00
Alexey Sedunov 6b0968c939 Refactoring: Extract AbstractParameterTablePanel class 2016-07-20 11:46:55 +03:00