Files
kotlin-fork/compiler/testData/ir/irText/firProblems
Nikolay Lunyak ed493c99e3 [FIR] Unset EnhancedNullability on withNullability() calls
Note that `FlexibleNullability` doesn't
exist anymore: it was removed at
`65ea4e18`.

`preserveEnhancedNullability = true`
was needed because if we have an
`@EnhancedNullability DNN`, and we
substitute something into it, then
`withNullability` is called there becase
that's how DNNs work, not becase we want
to obtain some new type with a
different nullability.

This is backed by
the `compiler/testData/diagnostics/tests/j+k/integerNotNullable.kt` test
 where we first have
 `@EnhancedNullability T & Any`, then
 we substitute `{T -> kotlin/Int!}` and
 then inside
 `org.jetbrains.kotlin.fir.resolve.substitution.AbstractConeSubstitutor#substituteOriginal`
 (this is a DNN-specific function) we
 call `withNullability(NOT_NULL)`,
 and expect the attribute to be preserved. Otherwise this test would
 fail with
 `OVERLOAD_RESOLUTION_AMBIGUITY` for
 `IntBox().put(1)`.

^KT-50221 Fixed


Merge-request: KT-MR-11272
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2023-07-25 07:03:04 +00:00
..
2023-01-31 13:43:26 +00:00