Commit Graph

2648 Commits

Author SHA1 Message Date
Mikhail Glukhikh ecfc2236a6 Fix script properties kind in modifier checker #KT-18234 Fixed 2017-06-05 17:22:11 +03:00
Mikhail Glukhikh adbece82ef Clear DF info for variables assigned in 'try' #KT-17929 Fixed 2017-05-26 15:39:27 +03:00
Mikhail Glukhikh 0fd70df681 Add tests for KT-17929 2017-05-26 15:39:25 +03:00
Dmitry Petrov 2c83718452 Prohibit having duplicate parameter names in functional types
#KT-15804 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov 9908212c99 Report VIRTUAL_MEMBER_HIDDEN on declaration name
#KT-13749 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov d850f01c39 Fix diagnostic for uninitialized extension property without accessors
#KT-8612 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov 902d3af280 Prohibit extending kotlin.Enum directly
#KT-7773 Fixed
2017-05-26 13:58:46 +03:00
Mikhail Glukhikh af3a123c15 Report WRONG_MODIFIER_CONTAINING_DECLARATION for vararg in setter 2017-05-26 09:47:51 +03:00
Mikhail Zarechenskiy 400ecd5e13 Support destructuring declarations in scripts and REPL
#KT-5620 In Progress
 #KT-15810 In Progress
2017-05-25 16:46:04 +03:00
Dmitry Petrov 7600b6de52 Allow top-level type aliases in scripts 2017-05-24 11:20:22 +03:00
Alexander Udalov 6d47991172 Minor, use other package in test data file
To avoid rendering contents of package org.intellij.lang.annotations
into the corresponding .txt file
2017-05-22 18:15:32 +03:00
Mikhael Bogdanov ba06ad3e53 Minor. Fix test directive 2017-05-22 08:31:03 +02:00
Mikhael Bogdanov f4a388cf71 Add new tests for default lambda inlining 2017-05-18 18:18:14 +02:00
Mikhael Bogdanov 42074f143d Report diagnostic on inline parameter usage inside defaul value for another inline parameter 2017-05-18 18:18:13 +02:00
Dmitry Petrov c1ef0bfcdb Report deprecation on usage of type alias expanded to a deprecated class
#KT-15243 Fixed
2017-05-18 10:56:02 +03:00
Dmitry Petrov a2db4dc0d5 Fix incremental compilation problems related to type alias constructors
1. Determine source element for descriptors with NO_SOURCE recursively.

2. Always provide type abbreviation for type alias constructor
return type.

 #KT-15495 Fixed
2017-05-18 10:55:16 +03:00
Mikhael Bogdanov 0ac23c789e Add diagnostics for default lambda inlining 2017-05-17 10:19:54 +02:00
fitermay e30b9758f4 Introduce action to add missing when branches on sealed class
Made via diagnostics NON_EXHAUSTIVE_WHEN_FOR_SEALED_CLASS
with INFO severity and quick-fix
So #KT-17580 Fixed
2017-05-16 16:43:27 +03:00
Dmitry Jemerov 675305fef3 Don't highlight 'this' references as deprecated
#KT-17613 Fixed
2017-05-15 14:57:52 +02:00
Mikhail Zarechenskiy ac8fbce249 Fix false "useless cast" when target type is flexible
#KT-17820 Fixed
2017-05-15 11:24:39 +03:00
Dmitry Neverov cd24adac32 Detect redundant 'is' check
#KT-14187 Fixed
2017-05-15 11:24:35 +03:00
Mikhail Zarechenskiy fba52359ac Add tests for obsolete issues
#KT-13112 Obsolete
 #KT-14249 Obsolete
2017-05-10 13:52:26 +03:00
Mikhail Zarechenskiy adb8e60615 Fix resolve of last destructuring declaration in block
Last declaration in block is resolved in DEPENDENT mode because it has
 influence on return type and therefore fake call for destructuring declaration
 wasn't completed (see `getBlockReturnedTypeWithWritableScope`)

 Now we resolve fake call for destructuring declaration in INDEPENDENT
 mode as it doesn't have effect on return type

 #KT-15480 Fixed
2017-05-05 21:30:38 +03:00
Mikhail Zarechenskiy 7530a9426f Warn about val reassignment via backing field
#KT-16681 In Progress
2017-05-05 21:30:37 +03:00
Mikhail Zarechenskiy 7541a3754d Move SAM constructors to synthetic scope 2017-05-05 21:30:35 +03:00
Mikhail Zarechenskiy 95ede7fb67 Move SAM adapters from static scope to synthetic one 2017-05-05 21:30:10 +03:00
Mikhail Glukhikh 1273166ed0 Do not report redundant else for enum / sealed from another module
Related to KT-17497
2017-05-04 14:17:43 +03:00
Mikhail Glukhikh 14886827a2 Introduce warning REDUNDANT_ELSE_IN_WHEN #KT-17497 Fixed 2017-05-04 14:17:41 +03:00
Mikhail Glukhikh e53c548ead Consider property external if all accessors are external #KT-13997 Fixed 2017-05-04 14:17:40 +03:00
Mikhail Glukhikh b5d0de7c3f Add test for KT-17479 looks like #KT-17479 Fixed
(after CAPTURED_MEMBER_VAL_INITIALIZATION introduction)
2017-05-02 19:59:43 +03:00
Mikhail Glukhikh 28283bad3e Introduce special CAPTURED_VAL_INITIALIZATION for members 2017-05-02 19:59:37 +03:00
Mikhail Glukhikh 56e633e345 CFA: detect captured writes more precisely
So #KT-14381 Fixed
So #KT-13597 Fixed
Also refactors captured writes detection inside DFA
2017-05-02 19:59:23 +03:00
Mikhail Glukhikh 8fa739ed0f Test for KT-14381 and KT-13597 2017-05-02 19:02:01 +03:00
Mikhail Glukhikh fbc1d1a844 Clear var nullability in loops more accurately #KT-14977 Fixed 2017-05-02 19:01:48 +03:00
Denis Zharkov c970763a7f Fix callable reference resolution regression
The regression appeared after
b5a8ffaddc
when we started trying both static and member methods until
first success and when there is no successful
we were just leaving the last one (e.g. private member)

But the actual problem is that we were commiting the trace
in case of single (but incorrect) result in resolution mode of
SHAPE_FUNCTION_ARGUMENTS when we couldn't yet choose the
correct static method

Also we shouldn't choose a shape for callable reference
using only the knowledge that result is single:
it may lead to the wrong inference result
(see test with Pattern::compile)

 #KT-17597 Fixed
2017-04-27 18:38:10 +03:00
Mikhail Zarechenskiy 7af10769c9 Enable control flow checks for functions without body
Except checks for tail recursive calls

 #KT-7796 Fixed
2017-04-27 15:50:18 +03:00
Mikhail Glukhikh 14e798a1fc Take imported from object descriptor into account in pseudocode
So #KT-15566 Fixed
2017-04-27 15:27:41 +03:00
Denis Zharkov 62a55b7b00 Fix false-positive resolution ambiguity when using akka
com.typesafe.akka:akka-cluster-sharding_2.12:2.5
akka.cluster.sharding.ClusterSharding  has the following methods:

    public static ClusterSharding get(ActorSystem var0) {
        return ClusterSharding$.MODULE$.get(var0);
    }

    public static Extension get(ActorSystem var0) {
        return ClusterSharding$.MODULE$.get(var0);
    }

NB: ClusterSharding  <: Extension
None of these methods is synthetic or something, but javac allows
calls like ClusterSharding.get(null)  and they get resolved
to the first method returning ClusterSharding

It seems that both javac and IntelliJ resolution algorithms filter out
such clashing declarations choosing the one that has the most
specific return type, the same idea is applied in the change

 #KT-17560 Fixed
2017-04-24 17:54:01 +03:00
Mikhail Zarechenskiy f3ed75998e Simplify resolve for control labels by using PSI
Diagnostic `NOT_A_RETURN_LABEL` wasn't quite useful and its eliminating allows to simplify label resolver a lot. It could be also added using PSI
2017-04-18 10:23:19 +03:00
Mikhail Zarechenskiy 32f609ceee Check lambda parameter for name shadowing
#KT-5160 Fixed
2017-04-17 17:12:44 +03:00
Mikhail Zarechenskiy b60efab62e Fix using qualified this with labeled function literals
#KT-9251 Fixed
2017-04-17 16:21:07 +03:00
Mikhail Zarechenskiy b17b3f4c63 Resolve local function parameters with function inner scope
This allows to use type parameters and value paramters in default value expressions

 #KT-7984 Fixed
 #KT-7985 Fixed
2017-04-17 16:21:06 +03:00
Mikhail Zarechenskiy e86d52b681 Fix return type of private members that return anonymous object
#KT-16813 Fixed

Anonymous objects returned from private-in-file members should behave as for private class members
2017-04-17 16:21:05 +03:00
Mikhail Zarechenskiy 1fbd8f3f53 Support automatic labeling for infix calls
#KT-8877 Fixed
2017-04-17 16:21:03 +03:00
Mikhail Zarechenskiy 6a352bccb6 Resolve control label locally when label name clashes with fun name
#KT-5354 Fixed
 #KT-15085 Fixed
2017-04-17 16:21:02 +03:00
Dmitry Petrov e0ebaac70c Perform additional checks on catch parameter declaration
KT-8320 It should not be possible to catch a type parameter type
KT-7645 Prohibit default value for `catch`-block parameter
2017-04-13 16:23:17 +03:00
Dmitry Petrov 5ccfbcbe22 KT-4960 Redeclaration is not reported for type parameters of interfaces
When resolving a class body for a class without a primary constructor
(e.g., an interface), no checks were performed for redeclarations
in the corresponding class header.
Creating & initializing a lexical scope of an appropriate kind will do it.
Note that since class has no primary constructor, only type parameters
could be redeclared (and that's KT-4960).
2017-04-13 15:57:24 +03:00
Mikhail Zarechenskiy 682fe9e9ca Don't forget to resolve annotations from constructor parameter
#KT-12245 Fixed
2017-04-10 12:48:10 +03:00
Mikhail Zarechenskiy c9b468581a Fix type checking of local return inside return expression
#KT-16426 Fixed
2017-04-10 12:48:09 +03:00
Mikhail Zarechenskiy 7f287a4230 Support warning about useless cast on safe cast
#KT-13348 Fixed
2017-04-10 12:48:09 +03:00