Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0158-rdar40165062.swift
Holly Borla dca1373e46 [ConstraintSystem] Don't fail in matchTypes when two primary archetype types
are not equal when part of a type requirement. This allows the
SkipSameTypeRequirement constraint fix to be applied instead.
2019-10-18 17:34:03 -07:00

16 lines
377 B
Swift

// RUN: %target-typecheck-verify-swift
struct Foo<T, U> {
var value: U
func bar() -> Foo<T, U> {
return Foo(value)
// expected-error@-1 {{referencing initializer 'init(_:)' on 'Foo' requires the types 'T' and 'U' be equivalent}}
}
}
extension Foo where T == U { // expected-note {{where 'T' = 'T', 'U' = 'U'}}
init(_ value: U) {
self.value = value
}
}