Skip to content

Commit 76d233a

Browse files
Constraint solving algorithm fix for case A? <: B?
1 parent 0a9ffb6 commit 76d233a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

docs/src/md/kotlin.core/type-constraints.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ A *resolved type* in this context is any type which does not contain inference v
7070
- Otherwise, if $T$ is a flexible type of the form $(\alpha..\alpha?)$ where $\alpha$ is an inference variable, a new bound $(S..S?) <: \alpha$ is added to current solution;
7171
- Otherwise, if $S$ is a nullable type of the form $A?$ and:
7272
- If $T$ is a known non-nullable type (a classifier type, a nullability-asserted type $B!!$, a type variable with a known non-nullable lower bound, or an intersection type containing a known non-nullable type), this is an inference error;
73-
- Otherwise, if $T$ is also a nullable type of the form $B?$, the constraint is reduced to $A <: B$;
74-
- Otherwise, the constraint is reduced to $A <: T$;
73+
- Otherwise, the constraint is reduced to $A <: T$. Also, if $T$ is also a nullable type of the form $B?$, an additional constraint $A!! <: B$ is introduced;
7574
- Otherwise, if $S$ is a flexible type of the form $(B..A?)$ and:
7675
- If $T$ is a nullable type of form $C?$, the constraint is reduced to $(B..A) <: C$, or to $A <: C$ if $A \equiv B$;
7776
- Otherwise, the constraint is reduced to $(B..A) <: T$, or to $A <: T$ if $A \equiv B$;

0 commit comments

Comments
 (0)