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-21 20:58:46 +00:00
2021-08-03 00:17:33 +03:00
2022-12-12 16:21:07 +00:00
2022-11-22 15:46:19 +00:00
2022-09-30 21:39:20 +03:00
2023-01-02 16:36:02 +00:00
2022-05-18 21:19:57 +03:00
2022-07-22 16:03:52 +00:00
2022-08-12 09:35:27 +00:00
2022-05-18 21:19:57 +03:00
2022-12-20 08:12:09 +00:00
2022-12-12 16:21:07 +00:00
2022-12-12 16:21:07 +00:00
2022-03-23 21:13:33 +00:00
2022-12-12 16:21:07 +00:00
2022-06-06 09:39:29 +00:00
2021-10-05 15:30:39 +03:00
2022-06-28 16:58:20 +02:00
2022-12-12 16:21:07 +00:00
2021-08-19 15:25:50 +03:00
2022-12-12 16:21:07 +00:00
2022-12-12 16:21:07 +00:00
2021-10-27 12:26:59 +03:00
2022-12-12 16:21:07 +00:00
2022-12-12 16:21:07 +00:00
2022-09-30 21:39:20 +03:00
2022-12-12 16:21:07 +00:00
2022-12-15 12:12:19 +00:00
2022-02-23 14:21:59 +03:00
2022-12-12 16:21:07 +00:00
2022-06-16 22:14:17 +02:00
2022-12-12 16:21:07 +00:00
2021-11-08 19:01:35 +01:00
2022-04-05 15:50:43 +00:00
2022-12-12 11:39:04 +00:00
2022-07-27 15:29:41 +00:00
2023-01-02 16:36:02 +00:00
2022-12-12 16:21:07 +00:00
2022-12-09 12:02:05 +00:00
2023-01-02 16:36:02 +00:00
2022-12-08 10:19:27 +00:00
2022-12-20 21:26:56 +00:00
2022-12-12 16:21:07 +00:00
2023-01-02 16:36:02 +00:00
2022-12-15 12:12:19 +00:00
2022-12-12 16:21:07 +00:00
2022-09-16 07:15:43 +00:00
2022-03-23 21:13:33 +00:00
2022-03-09 15:19:26 +00:00
2022-11-24 19:47:21 +00:00
2021-11-12 15:20:45 +03:00
2021-08-03 00:17:33 +03:00
2022-12-12 16:21:07 +00:00
2022-12-12 16:21:07 +00:00
2022-12-12 16:21:07 +00:00
2022-09-30 21:39:20 +03:00
2022-12-15 12:12:19 +00:00
2022-07-22 16:03:52 +00:00
2022-12-09 15:10:03 +00:00
2022-11-15 15:06:58 +00:00
2022-12-15 12:12:19 +00:00
2023-01-02 16:36:02 +00:00
2022-12-12 16:21:07 +00:00
2022-12-12 16:21:07 +00:00
2021-09-10 00:49:07 +03:00
2022-12-12 16:21:07 +00:00
2022-12-15 12:12:19 +00:00
2022-11-22 15:46:19 +00:00
2023-01-02 16:36:02 +00:00
2022-02-25 11:46:27 +00:00
2022-05-18 21:19:57 +03:00
2022-11-26 18:01:49 +00:00
2023-01-02 14:03:42 +01:00
2023-01-02 16:36:02 +00:00
2022-12-12 16:21:07 +00:00
2022-12-15 12:12:19 +00:00
2022-11-26 18:01:49 +00:00
2022-12-09 12:02:05 +00:00
2022-09-30 21:39:20 +03:00
2021-10-27 12:26:59 +03:00
2022-12-12 16:21:07 +00:00
2022-09-30 21:39:20 +03:00
2022-03-23 21:13:33 +00:00
2022-12-12 16:21:07 +00:00
2022-02-18 17:44:40 +03:00
2022-07-27 15:29:41 +00:00
2022-11-29 14:47:59 +00:00
2022-10-10 22:03:58 +00:00
2022-12-12 16:21:07 +00:00
2022-04-05 15:50:45 +00:00
2022-12-12 17:27:19 +01:00
2021-11-17 15:26:38 +03:00
2022-12-12 16:21:07 +00:00
2022-11-08 14:51:33 +01:00
2023-01-02 16:36:02 +00:00
2022-12-12 16:21:07 +00:00
2021-12-28 20:08:56 +03:00
2022-12-15 12:12:19 +00:00
2022-12-15 12:12:19 +00:00
2022-12-12 16:21:07 +00:00
2022-07-22 16:03:52 +00:00
2022-12-15 12:12:19 +00:00
2022-12-15 12:12:19 +00:00
2022-10-12 20:53:02 +00:00
2022-11-22 15:44:28 +00:00
2021-08-13 18:32:27 +03:00
2021-08-13 18:32:27 +03:00
2021-08-13 18:32:27 +03:00
2021-08-13 18:32:27 +03:00
2021-07-20 13:29:00 +03:00
2021-05-25 13:28:26 +03:00
2021-05-25 13:28:27 +03:00
2021-07-30 16:58:06 +00:00
2021-05-25 13:28:26 +03:00
2021-05-25 13:28:26 +03:00
2022-07-27 15:29:43 +00:00
2021-05-25 13:28:27 +03:00
2022-11-21 16:17:51 +00:00
2022-02-25 11:46:27 +00:00
2021-10-27 12:26:59 +03:00
2021-10-27 12:26:59 +03:00
2021-10-27 12:26:59 +03:00
2021-08-25 21:53:23 +00:00
2021-08-25 21:53:23 +00:00
2021-05-25 13:28:26 +03:00
2021-05-25 13:28:27 +03:00
2021-11-12 15:20:44 +03:00
2022-12-09 12:02:05 +00:00
2022-12-12 16:21:07 +00:00
2022-12-12 16:21:07 +00:00
2021-05-25 13:28:26 +03:00
2022-01-14 14:26:49 +03:00
2022-03-23 21:13:33 +00:00
2021-12-15 22:23:02 +03:00
2022-03-23 21:13:33 +00:00
2021-08-25 21:53:23 +00:00
2021-05-25 13:28:26 +03:00
2022-12-12 16:21:07 +00:00
2022-12-12 16:21:07 +00:00
2022-05-18 21:19:57 +03:00
2022-02-25 11:46:27 +00:00
2022-02-25 11:46:27 +00:00
2021-09-10 00:49:00 +03:00
2021-08-18 16:03:01 +03:00
2022-01-14 22:20:44 +03:00
2022-01-14 22:20:44 +03:00
2022-09-30 21:39:20 +03:00
2022-09-30 21:39:20 +03:00
2022-03-23 21:13:33 +00:00
2022-11-22 15:46:19 +00:00
2021-05-25 13:28:27 +03:00
2022-03-23 21:13:33 +00:00
2021-06-29 02:00:09 +03:00
2021-06-29 02:00:09 +03:00
2021-05-25 13:28:26 +03:00
2021-05-25 13:28:27 +03:00
2021-05-25 13:28:29 +03:00
2022-11-22 15:46:19 +00:00
2021-08-18 16:03:01 +03:00
2022-02-04 16:57:22 +03:00
2021-05-20 13:46:27 +03:00
2021-08-06 11:49:34 +03:00
2022-11-16 12:27:12 +00:00
2022-11-16 12:27:12 +00:00
2022-11-16 12:27:12 +00:00
2021-05-25 13:28:26 +03:00
2022-01-17 21:27:14 +03:00
2022-03-23 21:13:33 +00:00
2021-07-28 23:17:31 +03:00
2022-09-30 21:39:20 +03:00
2022-09-30 21:39:20 +03:00
2022-04-13 12:53:27 +02:00
2022-03-03 12:57:04 +00:00
2022-03-03 12:57:04 +00:00
2022-04-12 10:55:12 +00:00
2022-07-22 16:03:52 +00:00
2022-09-28 13:38:18 +00:00
2022-09-28 13:38:18 +00:00
2022-09-28 13:38:18 +00:00
2022-11-03 08:30:09 +00:00
2022-11-03 08:30:09 +00:00
2022-04-20 22:31:54 +03:00
2022-11-22 10:54:09 +00:00
2022-11-22 10:54:09 +00:00
2022-11-22 10:54:09 +00:00
2022-11-25 10:19:58 +00:00
2022-11-25 10:19:58 +00:00
2022-11-25 10:19:58 +00:00
2022-11-25 10:19:58 +00:00
2021-07-07 16:19:28 +03:00
2022-12-20 08:12:09 +00:00
2021-05-20 20:32:58 +02:00
2021-05-20 20:32:58 +02:00
2021-06-25 20:57:45 +03:00
2022-12-12 16:21:07 +00:00
2022-12-12 16:21:07 +00:00
2022-11-23 18:29:29 +00:00
2022-11-23 18:29:29 +00:00
2022-11-23 18:29:29 +00:00
2022-11-23 18:29:29 +00:00
2022-11-23 18:29:29 +00:00
2022-11-23 18:29:29 +00:00
2021-05-25 13:28:27 +03:00
2021-05-25 13:28:27 +03:00
2021-05-20 13:46:27 +03:00
2021-08-18 16:03:01 +03:00
2021-05-20 13:46:32 +03:00
2021-08-18 16:03:01 +03:00
2022-12-12 16:21:07 +00:00
2021-10-03 17:10:06 +03:00
2021-10-27 12:26:59 +03:00
2021-09-14 19:13:47 +03:00
2022-03-23 21:13:33 +00:00
2022-03-23 21:13:33 +00:00
2022-12-12 16:21:07 +00:00
2022-12-12 16:21:07 +00:00
2022-03-23 21:13:33 +00:00
2022-12-12 16:21:07 +00:00
2021-07-30 18:07:35 +03:00
2022-10-13 18:11:49 +00:00
2022-10-13 18:11:49 +00:00
2022-10-13 18:11:49 +00:00
2022-05-18 21:19:57 +03:00
2022-12-15 12:12:19 +00:00
2022-12-12 16:21:07 +00:00
2021-09-17 01:59:06 +03:00
2021-08-16 19:12:31 +03:00
2021-08-16 19:12:31 +03:00
2021-05-25 13:28:26 +03:00
2021-05-25 13:28:27 +03:00
2022-01-17 21:27:14 +03:00
2022-03-23 21:13:33 +00:00
2022-06-17 23:26:16 +00:00
2022-01-17 21:27:14 +03:00
2022-03-23 21:13:33 +00:00
2021-12-23 17:45:50 +03:00
2021-12-23 17:45:50 +03:00
2022-05-18 21:19:57 +03:00
2021-12-23 17:45:50 +03:00
2021-12-23 17:45:50 +03:00
2021-12-23 17:45:50 +03:00
2021-12-23 17:45:50 +03:00
2022-05-18 21:19:57 +03:00
2021-12-23 17:45:50 +03:00
2021-12-23 17:45:50 +03:00
2021-11-24 23:13:41 +03:00
2022-12-15 12:12:19 +00:00
2021-11-24 23:13:41 +03:00
2021-05-25 13:28:26 +03:00
2022-02-25 11:46:27 +00:00
2022-02-25 11:46:27 +00:00
2022-02-25 11:46:27 +00:00
2021-07-29 19:45:55 +02:00
2022-03-28 12:37:25 +00:00
2022-02-25 11:46:27 +00:00
2022-02-25 11:46:27 +00:00
2022-02-25 11:46:27 +00:00
2021-08-10 19:36:43 +03:00
2021-05-25 13:28:26 +03:00
2021-05-25 13:28:27 +03:00
2022-05-18 21:19:57 +03:00
2021-05-25 13:28:26 +03:00
2021-05-25 13:28:27 +03:00
2022-11-08 14:51:33 +01:00
2022-10-25 12:33:08 +00:00
2022-11-01 12:03:26 +00:00
2022-10-25 12:33:08 +00:00
2022-10-25 12:33:09 +00:00
2022-10-25 12:33:09 +00:00
2021-09-28 22:30:09 +03:00
2021-09-14 23:48:50 +03:00
2021-10-01 14:37:54 +02:00
2021-09-14 23:48:50 +03:00
2021-09-28 22:30:09 +03:00
2021-09-14 23:48:50 +03:00
2022-06-07 14:12:13 +00:00
2022-06-07 14:12:13 +00:00
2022-06-07 14:12:13 +00:00
2021-09-28 22:30:09 +03:00
2022-05-18 21:19:57 +03:00
2021-09-28 22:30:09 +03:00
2021-09-28 22:30:20 +03:00
2021-09-28 22:30:09 +03:00
2021-09-28 22:30:20 +03:00
2022-05-18 21:19:57 +03:00
2021-09-28 22:30:09 +03:00
2021-09-28 22:30:09 +03:00
2021-09-14 23:48:50 +03:00
2021-09-28 22:30:09 +03:00
2021-09-14 23:48:50 +03:00
2021-11-24 23:13:41 +03:00
2021-11-24 23:13:41 +03:00
2022-11-08 14:51:33 +01:00
2021-07-19 13:40:28 +03:00
2021-10-27 12:26:59 +03:00
2021-07-30 16:58:05 +00:00
2022-02-10 21:20:47 +00:00
2021-07-30 16:58:05 +00:00
2022-05-18 21:19:57 +03:00
2021-07-15 19:02:58 +03:00
2022-09-13 16:45:06 +00:00
2021-10-20 22:05:24 +03:00
2021-05-25 13:28:26 +03:00