Removed unnecessary check to prevent infinite recursion in incorporation
This commit is contained in:
+3
-3
@@ -4,11 +4,11 @@ EQUAL T Int
|
|||||||
EQUAL T My<T>
|
EQUAL T My<T>
|
||||||
|
|
||||||
type parameter bounds:
|
type parameter bounds:
|
||||||
T := Int, := My<T>*
|
T := Int, := My<T>*, := My<Int>
|
||||||
|
|
||||||
status:
|
status:
|
||||||
-hasCannotCaptureTypesError: false
|
-hasCannotCaptureTypesError: false
|
||||||
-hasConflictingConstraints: false
|
-hasConflictingConstraints: true
|
||||||
-hasContradiction: true
|
-hasContradiction: true
|
||||||
-hasErrorInConstrainingTypes: false
|
-hasErrorInConstrainingTypes: false
|
||||||
-hasTypeConstructorMismatch: false
|
-hasTypeConstructorMismatch: false
|
||||||
@@ -18,4 +18,4 @@ status:
|
|||||||
-isSuccessful: false
|
-isSuccessful: false
|
||||||
|
|
||||||
result:
|
result:
|
||||||
T=Int
|
T=???
|
||||||
-3
@@ -75,9 +75,6 @@ private fun ConstraintSystemImpl.generateNewBound(bound: Bound, substitution: Bo
|
|||||||
// Here <=> means lower_bound, upper_bound or exact_bound constraint.
|
// Here <=> means lower_bound, upper_bound or exact_bound constraint.
|
||||||
// Then a new bound 'T <=> My<_/in/out Type>' can be generated.
|
// Then a new bound 'T <=> My<_/in/out Type>' can be generated.
|
||||||
|
|
||||||
// We don't substitute anything into recursive constraints
|
|
||||||
if (substitution.typeVariable == bound.typeVariable) return
|
|
||||||
|
|
||||||
val substitutedType = when (substitution.kind) {
|
val substitutedType = when (substitution.kind) {
|
||||||
EXACT_BOUND -> substitution.constrainingType
|
EXACT_BOUND -> substitution.constrainingType
|
||||||
UPPER_BOUND -> CapturedType(TypeProjectionImpl(Variance.OUT_VARIANCE, substitution.constrainingType))
|
UPPER_BOUND -> CapturedType(TypeProjectionImpl(Variance.OUT_VARIANCE, substitution.constrainingType))
|
||||||
|
|||||||
Reference in New Issue
Block a user