Commit Graph

1084 Commits

Author SHA1 Message Date
Anna Kozlova
f1536bb969 use lambda to avoid context remapping (IDEA-185448)
for anonymous class this expressions have to be encoded to point to outer class, for lambda expressions there is no need for that. Leave unchanged (array initializer) for old java versions
2018-01-30 19:38:53 +03:00
Anna Kozlova
ca1d8a348c postpone highlighting on conditions when errors occur on containing call
poly conditional expression receives type from context, if context contains errors, it's better to highlight those first (IDEA-185540)
2018-01-30 11:33:49 +03:00
Anna Kozlova
04b7efb5cd don't calculate substitution for overload resolution applicability checks 2018-01-22 17:07:38 +03:00
Anna Kozlova
e037922937 applicability: get call expr from anonymous class (IDEA-184965) 2018-01-15 20:27:05 +01:00
peter
9c671df7d1 complete Collectors methods inside collect() call (IDEA-181449) 2018-01-08 18:52:37 +01:00
Anna.Kozlova
52bd45c9b2 reject functional expressions as conditional condition (IDEA-184667) 2018-01-08 17:05:50 +01:00
Anna.Kozlova
20ea015d3e inference: ensure to distinguish new fresh variables of the same node 2017-12-22 10:05:44 +01:00
Anna.Kozlova
15020a138d enum constants resolution cached (IDEA-183841) 2017-12-18 10:23:01 +01:00
peter
9ad8c63df4 java completion: lambda items should be higher than recently selected items (IDEA-183824) 2017-12-15 20:12:49 +01:00
Anna.Kozlova
9e20e117d6 skip inference for incompatible method references
EA-103416 - assert: PsiMethodReferenceCompatibilityConstraint.getSubstitutor
2017-12-14 18:45:49 +01:00
Anna.Kozlova
1d6641db80 overload resolution: check method hiding for static only (IDEA-183712)
non-static methods should already be covered by same signatures check
2017-12-13 14:10:59 +01:00
peter
beb4f6dba7 move completion suggestions before lambda only when they really match specific expected type (IDEA-183592) 2017-12-12 17:55:37 +01:00
Anna.Kozlova
1fc76eb779 calc types by applicability constraints if inference fails
include all inference variables for resolve and ignore additional constraints checks if the inference is going to failure; this way if (expr()) would get type of the 'standalone' expression instead of expression with boolean as expected type
2017-12-07 15:51:06 +01:00
Anna.Kozlova
6180b5b337 inference: check substituted intersection type during resolution 2017-12-06 14:54:24 +01:00
Anna.Kozlova
e67bf2488b method references: do not prefer varargs from first search (IDEA-182018) 2017-11-13 16:41:50 +01:00
peter
76641748e0 java completion: prefer lambdas over method references (IDEA-181662) 2017-11-07 21:51:31 +01:00
Anna.Kozlova
a2e13fee96 inference: check glb conflicts after flatten in intersection type(IDEA-181017) 2017-10-25 18:01:56 +02:00
Anna.Kozlova
c8f8341d2f don't treat static method as concrete in hierarchy (IDEA-180930) 2017-10-25 18:01:56 +02:00
Anna.Kozlova
6bb976899e overload resolution: resolve conflicts with static methods in super interfaces 2017-10-24 10:57:06 +02:00
Anna.Kozlova
2658d37da0 inference: don't remember captured wildcard with non-proper bound (IDEA-180042)
later check could fail e.g. if bound was created inside one of nested session
2017-10-17 17:58:55 +02:00
Anna.Kozlova
bffca304b9 glb: ensure each super class processed once (IDEA-176779) 2017-10-17 11:48:38 +02:00
Anna.Kozlova
465458db4d method references: don't fall to raw substitutor with second search (IDEA-180615) 2017-10-17 11:48:38 +02:00
Anna.Kozlova
250956f8b0 report inference error if resolution failed (IDEA-179978)
in the issue, non-vararg overload candidate was chosen cause it was not filtered as inapplicable
2017-10-13 10:47:47 +02:00
Anna.Kozlova
2f1a299401 captured of non-proper wildcard can't be used as solving bound (IDEA-180042) 2017-10-12 19:38:49 +02:00
Anna.Kozlova
14cb19fa39 overload resolution: accept unqualified calls of static interface methods (IDEA-180236) 2017-10-09 15:00:48 +02:00
Anna.Kozlova
9728678ff4 method references: don't swallow errors during method ref inference (IDEA-179706) 2017-09-29 14:31:21 +02:00
Anna.Kozlova
643e046c85 EA-107704 - assert: InferenceSession.<init> 2017-09-26 14:33:30 +02:00
peter
dd920e884e completion: place functional expressions after variables of expected type (IDEA-174428, IDEA-178600) 2017-09-15 22:04:11 +02:00
Anna Kozlova
b9e2c4130d inference: allow capture during intersection type construction (IDEA-173900) 2017-09-13 15:33:56 +03:00
Anna Kozlova
b0ccbdebcf exception inference: don't check non-applicable methods (IDEA-178762) 2017-09-12 21:05:35 +03:00
Anna Kozlova
8032558bec highlighting: don't check static methods for unrelated inheritance (IDEA-178539)
in class case, static methods must have signatures with different erasures, for interfaces, static methods
2017-09-06 19:42:01 +03:00
Anna Kozlova
b23c6b026b can complete normally: break inside switch (IDEA-178304)
break inside switch when switch is selected should not lead to abnormal completion
2017-09-04 12:28:22 +03:00
Anna.Kozlova
07fa74c8b5 inference: restore captured wildcard from fresh type parameter (IDEA-165871; IDEA-176592)
register return type constrain replaces wildcard parametrization with fresh variables aka custom capture conversion. When the specification would deal with these fresh type parameters further, IDEA expects them like PsiCapturedWildcards. Let's restore captured wildcards when inference failed to add any new constraints for fresh variables but initial upper bound of captured wildcard
2017-08-18 19:07:17 +02:00
Anna.Kozlova
3d1ba95725 unhandled exception: shrink the highlighted range (IDEA-177234) 2017-08-09 18:38:29 +02:00
Anna.Kozlova
dec0d16597 overload resolution: adapt return types before comparing (IDEA-177065) 2017-08-07 18:28:03 +02:00
Anna.Kozlova
6112ab8bb8 inference: avoid side effects from lambda parameter types calculation
process lambda siblings (IDEA-175947)
2017-07-17 15:17:53 +02:00
Anna.Kozlova
9e0394a757 lambda constraints: proceed with return expressions (IDEA-175426)
lambda with formal types won't lead to additional constraint after return type constraint processing, thus it need to be processed additionally
2017-07-05 16:48:52 +02:00
Anna.Kozlova
1699697000 testdata for IDEA-175280 2017-07-03 16:53:16 +02:00
Anna Kozlova
088510d098 skip warnings for constructor refs with varargs (IDEA-174074) 2017-06-27 19:47:53 +03:00
Anna Kozlova
0e5a7bca67 testdata for IDEA-174924 2017-06-23 18:19:42 +03:00
Anna Kozlova
d9145615c7 testdata 2017-06-22 21:46:30 +03:00
Anna Kozlova
cbe6eb48ed take into account container class type parameters: return type
detection if return type mentions type parameters should include types specified on outer class
2017-06-22 15:54:30 +03:00
Anna Kozlova
605dfb1c3c redundant cast: ensure cast type compared with ground type (IDEA-174369)
remove attempts to emulate that and reuse getGroundTargetType api
2017-06-13 20:27:13 +03:00
Anna Kozlova
fb928f72c6 lambda inference: conditional expressions in returns (IDEA-174301)
skip conditionals and parenthesis during find top expression
2017-06-13 16:12:45 +03:00
Anna Kozlova
634a945b0f apply unifying substitutor to compare return types (IDEA-174292)
attempt to apply incompatible return types in method hierarchy due to method type parameters used in return types
2017-06-13 16:12:44 +03:00
peter
03a663c63e IDEA-165006 Support chained completion for method references in Java 8+ 2017-06-05 19:20:02 +02:00
Anna Kozlova
12c350758d Interface.super method calls: ensure valid qualifier (IDEA-173888)
forbid calls to super methods which are overridden in direct superinterfaces
2017-06-05 14:34:18 +03:00
Anna Kozlova
377520ade5 intersection type validation fixed (IDEA-173900)
take type parameter bounds into account
2017-06-05 14:34:18 +03:00
Anna Kozlova
51bcfcecf9 inference: don't traverse up through lambda bounds when parent inference was already started, in this case it's exception inference which should work without top level node (EA-83073 - assert: LambdaUtil.treeWalkUp; IDEA-173467) 2017-05-26 13:36:45 +03:00
Anna Kozlova
011b8e4e10 checked exception constraints: ensure ground type (IDEA-173200) 2017-05-22 11:25:29 +03:00