Marco Pennekamp
5f554d0065
[FIR] KT-54980 Fix resolvability of too few/too many type arguments
...
- If too few or too many type arguments were provided, they were all
thrown away in `TypeArgumentMapping`,
`FirCallCompletionResultsWriterTransformer`, and `KtFirCallResolver`.
The fix handles type arguments of the wrong arity more gracefully.
- Note for `TypeArgumentMapping`: Excess type arguments are not needed
for candidate resolution. Excess type arguments are still resolved
due to the handling in `FirCallCompletionResultsWriterTransformer`.
- Post-processing in `AllCandidatesResolver`: When all candidates are
resolved in `AllCandidatesResolver.getAllCandidates`, the function
builds a FIR file. During that resolution, the
`generic<String, String>` call (in example
`functionCallWithTooFewTypeArguments.kt`) is correctly marked as
inapplicable, but the missing type argument is inferred as an error
type. `firFile` then contains a function call
`generic<String, String, ERROR>` instead of `generic<String, String>`.
This call is still marked as inapplicable. Despite that, the
*subsequent* resolution by
`bodyResolveComponents.callResolve.collectAllCandidates` disregards
the call's inapplicability and resolves successfully into an
applicable candidate. This is because `CandidateFactory` doesn't make
any guarantees for already inapplicable calls. The fix adds
post-processing to `AllCandidatesResolver` to preserve candidate
inapplicability.
- Most tests that this commit changes had slightly different results due
to type arguments becoming resolvable.
- `wrongNumberOfTypeArguments.kt` and
`wrongNumberOfArgumentsInTypeAliasConstructor.kt`:
`ConeDiagnostic.toFirDiagnostics` prefers specific errors. Because
`ARGUMENT_TYPE_MISMATCH` is specific and `INAPPLICABLE_CANDIDATE` is
not, only the former is reported. I see no reason to pass an illegally
typed argument in either test, so the change reduces the errors to
`INAPPLICABLE_CANDIDATE`.
- `typeAliasSamAdapterConstructors2.fir.kt`: See KT-55007.
- Disable `mismatchTypeParameters` JS backend test due to its handling
of excess type arguments. See KT-55250.
^KT-54980 fixed
2023-01-02 16:36:02 +00:00
..
2022-12-12 17:27:19 +01:00
2022-12-15 12:12:19 +00:00
2022-06-01 00:11:17 +04:00
2020-12-16 19:52:30 +03:00
2022-12-15 12:12:19 +00:00
2022-12-20 08:12:09 +00:00
2022-12-26 11:46:58 +00:00
2022-02-07 13:36:38 +03:00
2022-05-18 21:19:57 +03:00
2022-06-06 09:14:37 +00:00
2021-12-15 22:23:13 +03:00
2023-01-02 16:36:02 +00:00
2022-12-08 10:19:29 +00:00
2023-01-02 16:36:02 +00:00
2022-12-15 12:12:19 +00:00
2022-12-14 21:46:41 +00:00
2022-12-15 12:12:19 +00:00
2022-12-14 21:46:41 +00:00
2022-12-15 12:12:19 +00:00
2022-12-14 21:46:41 +00:00
2022-12-14 21:46:41 +00:00
2022-12-20 08:12:09 +00:00
2022-12-20 08:12:09 +00:00
2022-12-12 16:21:07 +00:00
2022-11-22 15:46:20 +00:00
2022-12-15 12:12:19 +00:00
2022-12-15 12:12:19 +00:00
2022-12-15 12:12:19 +00:00
2022-12-15 12:12:19 +00:00
2022-06-29 16:50:05 +00:00
2022-12-15 12:12:19 +00:00
2022-05-19 16:53:59 +00:00
2022-08-12 09:35:27 +00:00
2022-12-15 12:12:19 +00:00
2022-01-11 22:23:57 +00:00
2022-08-12 09:35:27 +00:00
2021-08-02 20:29:05 +03:00
2022-06-27 08:11:31 +00:00
2022-06-27 08:11:31 +00:00
2021-09-13 13:53:12 +03:00
2021-11-17 15:26:38 +03:00
2021-10-12 17:26:34 +03:00
2021-02-19 18:24:46 +03:00
2021-09-17 01:59:06 +03:00
2022-12-12 16:21:07 +00:00
2020-12-16 19:52:25 +03:00
2021-08-30 16:24:44 +03:00
2021-01-21 12:02:01 +03:00
2021-07-30 16:58:07 +00:00
2020-12-16 19:52:30 +03:00
2022-11-22 18:25:30 +01:00
2021-05-20 12:22:20 +03:00
2022-12-08 10:19:31 +00:00
2021-07-23 12:20:39 +03:00
2021-07-23 12:20:39 +03:00
2021-10-12 17:26:34 +03:00
2020-12-16 19:52:30 +03:00
2022-08-12 09:35:27 +00:00
2020-11-10 14:26:54 +03:00
2021-04-06 12:30:34 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2021-02-12 13:36:41 +03:00
2021-07-19 13:40:28 +03:00
2021-01-22 18:11:57 +03:00
2020-12-16 19:52:30 +03:00
2021-04-06 12:30:34 +03:00
2021-04-13 21:36:33 +03:00
2022-05-19 16:53:59 +00:00
2021-03-24 17:48:39 +03:00
2020-12-16 19:52:25 +03:00
2020-11-16 15:50:39 +03:00
2020-12-16 19:52:25 +03:00
2022-12-14 21:46:41 +00:00
2022-12-12 16:21:07 +00:00
2020-12-16 19:52:25 +03:00
2021-04-12 23:49:55 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2022-08-15 21:46:11 +00:00
2022-06-02 13:47:29 +00:00
2022-06-02 13:47:29 +00:00
2022-12-14 21:46:41 +00:00
2021-03-24 16:07:30 +03:00
2022-08-12 09:35:27 +00:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2021-06-03 20:41:58 +03:00
2021-06-03 20:41:58 +03:00
2021-03-24 21:24:18 +01:00
2021-06-03 20:41:58 +03:00
2021-09-17 01:59:06 +03:00
2020-12-16 19:52:30 +03:00
2020-12-16 19:52:25 +03:00
2020-11-10 14:26:54 +03:00
2020-12-16 19:52:25 +03:00
2021-04-06 12:30:34 +03:00
2020-12-16 19:52:25 +03:00
2021-07-19 13:40:28 +03:00
2021-06-21 18:45:38 +03:00
2021-04-23 17:29:34 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2022-04-21 19:23:20 +00:00
2022-04-21 19:23:20 +00:00
2020-12-16 19:52:25 +03:00
2020-10-16 15:24:57 +03:00
2022-01-11 13:56:17 +00:00
2022-01-11 13:56:17 +00:00
2021-02-09 15:20:34 +03:00
2021-03-11 13:25:51 +03:00
2022-12-14 21:46:41 +00:00
2021-08-10 19:36:44 +03:00
2022-05-12 21:22:22 +04:00
2022-05-12 21:22:22 +04:00
2022-05-12 21:22:22 +04:00
2022-05-12 21:22:22 +04:00
2022-05-12 21:22:22 +04:00
2022-05-12 21:22:22 +04:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:25 +03:00
2021-01-27 19:46:05 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2022-06-29 16:50:05 +00:00
2020-12-16 19:52:30 +03:00
2022-06-29 16:50:05 +00:00
2021-09-06 13:11:02 +03:00
2022-12-12 16:21:07 +00:00
2020-12-16 19:52:25 +03:00
2020-09-23 14:05:11 +03:00
2022-11-15 09:02:33 +02:00
2022-11-15 09:02:33 +02:00
2021-04-06 12:30:34 +03:00
2021-04-06 12:30:41 +03:00
2021-04-06 12:30:41 +03:00
2022-12-15 12:12:19 +00:00
2022-12-12 16:21:07 +00:00
2021-04-06 12:30:34 +03:00
2021-11-12 15:20:45 +03:00
2022-12-15 12:12:19 +00:00
2022-12-12 16:21:07 +00:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2022-12-14 21:46:41 +00:00
2020-12-16 19:52:30 +03:00
2022-09-07 12:34:26 +00:00
2022-09-07 12:34:26 +00:00
2020-12-16 19:52:25 +03:00
2021-04-29 22:31:38 +03:00
2021-02-19 18:24:46 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2021-10-12 17:26:34 +03:00
2020-12-16 19:52:30 +03:00
2021-10-05 12:17:08 +00:00
2020-12-16 19:52:30 +03:00
2022-12-14 21:46:41 +00:00
2020-12-16 19:52:30 +03:00
2020-12-16 19:52:25 +03:00
2021-02-10 12:29:34 +03:00
2021-01-22 18:11:57 +03:00
2020-12-16 19:52:30 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2022-12-15 12:12:19 +00:00
2021-05-20 13:46:34 +03:00
2022-06-29 16:50:05 +00:00
2020-11-10 14:26:54 +03:00
2021-02-12 13:36:41 +03:00
2022-03-15 13:08:18 +00:00
2022-03-15 13:08:18 +00:00
2022-08-04 22:56:07 +02:00
2022-08-04 22:56:08 +02:00
2021-02-12 13:36:41 +03:00
2021-03-29 12:45:27 +03:00
2021-04-05 16:17:34 +03:00
2021-05-17 22:33:18 +03:00
2022-12-14 21:46:41 +00:00
2021-03-04 17:56:29 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2022-06-29 16:50:05 +00:00
2020-12-16 19:52:30 +03:00
2022-12-14 21:46:41 +00:00
2020-10-21 11:53:10 +03:00
2021-04-05 15:54:57 +03:00
2021-04-05 15:54:57 +03:00
2020-12-16 19:52:25 +03:00
2020-05-20 15:12:32 +03:00
2021-11-12 15:20:42 +03:00
2021-04-20 18:13:03 +03:00
2022-03-15 13:08:18 +00:00
2022-03-15 13:08:18 +00:00
2022-06-29 16:50:05 +00:00
2021-04-13 21:36:41 +03:00
2022-12-15 12:12:19 +00:00
2021-06-07 15:25:47 +03:00
2021-10-12 17:26:34 +03:00
2020-12-16 19:52:30 +03:00
2020-12-16 19:52:25 +03:00
2022-12-15 12:12:19 +00:00
2022-11-08 14:51:33 +01:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2022-11-16 22:25:02 +00:00
2022-11-16 22:25:02 +00:00
2020-12-16 19:52:25 +03:00
2021-10-12 17:26:34 +03:00
2021-10-05 19:37:53 +03:00
2021-04-06 12:30:34 +03:00
2021-05-05 18:20:51 +03:00
2021-09-17 01:59:06 +03:00
2022-03-15 13:21:03 +00:00
2022-03-15 13:21:03 +00:00
2021-04-06 12:30:34 +03:00
2020-12-16 19:52:30 +03:00
2022-08-12 09:35:27 +00:00
2021-05-06 17:50:32 +03:00
2022-12-15 12:12:19 +00:00
2021-10-20 22:05:24 +03:00
2020-12-16 19:52:25 +03:00
2020-12-16 19:52:30 +03:00
2021-02-09 16:04:39 +03:00
2021-02-09 16:04:39 +03:00