Commit Graph

860 Commits

Author SHA1 Message Date
Anna Kozlova c95ba9968d testdata 2016-09-22 17:25:47 +03:00
Anna Kozlova 926d7063f5 fix testdata 2016-09-19 18:50:55 +03:00
Anna Kozlova b8f0e626b9 java 8 diamonds: include constructor's type parameters in inference constraints (IDEA-160918) 2016-09-19 17:43:55 +03:00
Anna Kozlova f4dae32d7f overload resolution: prefer candidates with functional formal type if lambda is passed; this way conflict would be resolved and nested error would be shown instead 2016-09-16 08:34:15 +03:00
peter d408fdc798 IDEA-161250 Semicolon added in the middle of code 2016-09-15 12:03:42 +02:00
Anna Kozlova 2ec75e05a1 method refs: prefer unhandled exception to wrong return type error (IDEA-160251) 2016-08-25 17:36:03 +03:00
Anna Kozlova 1bece25b95 inference: when unchecked conversion was applied, resolve variables against raw substitutor 2016-08-17 13:53:02 +03:00
peter 9776d5a28d speedup functional expression search (IDEA-159107)
* filter inapplicable expressions without loading AST if possible, via approximate resolve
* for that, store the approximate call chains in index
* iterate over files once, not for each empty marker Runnable interface separately
* don't rely on generic method parameter index: it's huge, memory-hungry and works only in Java
2016-08-13 12:12:19 +02:00
peter e8ea2598f3 fun expr search: minor improvements after reviews 2016-08-13 12:12:19 +02:00
Anna.Kozlova 369c9a24b4 diamonds: fix conflicting names between constructor and class type parameters (rename the constructor type parameters) 2016-08-09 15:52:11 +02:00
Anna.Kozlova 0e3d077bfe fix inheritance of abstract and default methods when multiple defaults are present 2016-08-09 15:52:11 +02:00
Anna Kozlova 8ac15c13de check context for functional expressions once (IDEA-159362) 2016-08-08 08:35:27 +02:00
Anna Kozlova ccf3beba42 check diamond applicability over static factory underneath (IDEA-159287) 2016-08-08 08:35:27 +02:00
peter 522e0b9c2d don't visit jdk Stream API usages when searching for unrelated functional interface implementations 2016-08-03 12:49:11 +02:00
peter c71a1e7136 IDEA-158267 Parameter completion overwrites the following lambda declaration ' () -> {}' 2016-07-27 12:15:56 +02:00
peter 22b9dc61a6 fin functional expressions of SAM interfaces related to the given one 2016-07-23 23:05:56 +02:00
peter 2a93e063bd rewrite functional expression search to use stub index 2016-07-22 17:41:21 +02:00
Anna.Kozlova 035b6d9d1f lambda return type inconsistency: highlight all found errors (IDEA-158853) 2016-07-21 19:03:45 +02:00
peter 1c451db9ad a test that lambdas in constructor calls are found 2016-07-21 12:16:42 +02:00
peter 0a4f995460 find lambdas passed into vararg methods 2016-07-21 12:16:41 +02:00
Anna.Kozlova 3ee60dba1d method ref: ensure top substitutor is not overridden with raw replacement from second method ref search (IDEA-158636) 2016-07-18 14:57:04 +02:00
Anna Kozlova 1193a54876 warn about unused parameter if method is used locally as method reference as it could be transformed to equivalent lambda (IDEA-157988) 2016-06-29 20:32:32 +03:00
Anna Kozlova 3cfd5be8c0 bombed test for resolution with cycle 2016-06-29 16:18:27 +03:00
Anna Kozlova 7968b2bbbb apply capture conversion for captured wildcard bound according to the direct supertype of parameterized type specification (IDEA-157586) 2016-06-22 15:24:15 +03:00
Anna Kozlova 3805d51554 subtyping constraint: apply capture conversion for captured wildcard bound according to the direct supertype of parameterized type specification 2016-06-22 15:24:15 +03:00
Anna Kozlova a330f9c2f7 inference: treeWalkUp if overload is done under current argumentList caused by lambda parameter type inference (IDEA-157676) 2016-06-22 15:24:15 +03:00
Anna Kozlova 1fcb534fcb highlight diamonds as type parameter list (IDEA-156859) 2016-06-06 17:52:24 +03:00
Anna Kozlova 3e7b1dca62 conditional: treat nulls separately and accept them as numeric/boolean branches (IDEA-157025) 2016-06-03 15:28:58 +03:00
Anna Kozlova 9c95fa5524 don't try to infer from top if overloaded flag is on (IDEA-156937) 2016-06-02 17:01:51 +03:00
Anna Kozlova d9c65ce4ee ensure functional interface is found if assigned to field in another file (IDEA-156592) 2016-05-31 20:21:14 +03:00
Anna Kozlova 99fe682d0b Revert: overload resolution: don't prefer concrete over abstract if the signatures are not override-equivalent (2bedb80d81) 2016-05-31 11:44:10 +03:00
Anna Kozlova 2bedb80d81 overload resolution: don't prefer concrete over abstract if the signatures are not override-equivalent 2016-05-30 11:28:01 +03:00
Anna Kozlova 7f8b5f8952 redundant cast: process branches of conditional expressions with respect to expected type for functional expressions (IDEA-156480) 2016-05-25 18:40:17 +03:00
peter dc64af7f22 IDEA-156379 Suggested "collect(Collectors.toList())" ignores static Collectors import 2016-05-24 15:21:50 +02:00
Anna.Kozlova 107abaf891 good code red: applicability check for non-generic method requires types calculation 2016-05-20 21:44:12 +02:00
Anna.Kozlova ce58f62d19 lambda.isValueCompatible should not cache inference results for calls inside lambda body as they may depend on incomplete top level inference where LambdaExpressionCompatibilityConstraint is reduced (IDEA-156311) 2016-05-20 18:52:45 +02:00
Anna.Kozlova ad6352ce0b upcoming changes to the spec and javac (JDK-8145614; JDK-8142876) 2016-05-20 18:52:45 +02:00
Anna.Kozlova 25352dce0b avoid checks over not applicable methods (IDEA-156196) 2016-05-19 16:47:28 +02:00
peter d167a4e820 don't suggest break/continue inside lambda/anonymous inside a loop (IDEA-CR-10869) 2016-05-19 10:58:51 +02:00
Anna.Kozlova 3dd26b5936 testdata on partially raw types inferred by javac 2016-05-09 19:42:35 +02:00
Anna.Kozlova d85c70d870 invocation type inference: don't create fresh variables for all type parameters but only for those where wildcards are used in return type (IDEA-155627; IDEA-151220; IDEA-151387) 2016-05-06 18:00:16 +02:00
peter 20f69c8111 remove wrong capture treatment: the completion result is incorrect (IDEA-155188) 2016-05-03 14:25:59 +02:00
peter 80ad8e9ebd IDEA-154276 Suggest method references to constructors of implementing classes when Supplier<AnAbstractClass> is expected 2016-05-02 08:58:57 +02:00
Anna.Kozlova b936f89275 redundant cast: ensure cast is not removed if operand changes it's type 2016-04-29 14:41:28 +02:00
Anna.Kozlova f36501444c clear diamond inference errors when overload resolution fails 2016-04-28 11:39:38 +02:00
Anna.Kozlova bebf4975e6 change signature: expand expr lambda to block lambda when exception should be caught; don't expand method ref to lambda when only unchecked exceptions were added (IDEA-152386) 2016-04-28 11:39:38 +02:00
peter 85601ec30c support captured types in incomplete overloaded lambda completion (IDEA-155188) 2016-04-26 10:23:35 +02:00
peter 3b725bc33e IDEA-155188 Lambda auto completion for incomplete overloaded method fails 2016-04-25 20:45:38 +02:00
Anna.Kozlova e588d2285a highlighting: don't add warning for nested lambda when problem is inside upper level (IDEA-155192) 2016-04-25 14:41:56 +02:00
Anna.Kozlova 5d6351b1ec diamonds: don't accept inferred types when error appeared during inference (IDEA-154619) 2016-04-21 18:39:23 +02:00