Files
swift-mirror/validation-test/compiler_crashers_2_fixed/sr11684.swift
Suyash Srijan 573aceeba3 [ConstraintSystem] Don't create a AllowArgumentMismatch fix when there is an argument type mismatch in synthesized wrappedValue init
This is because we already emit a diagostic to tell the user that the property's type does not match the wrappedValue type, so this diagnostic can be a bit confusing especially because the initializer is synthesized
2019-11-04 22:29:13 +00:00

22 lines
666 B
Swift

// RUN: %target-swift-frontend %s -typecheck -verify
@propertyWrapper
struct Wrapper1 { // expected-note {{property wrapper type 'Wrapper1' declared here}}
var wrappedValue: Int?
}
class Test1 {
@Wrapper1 var user: Int
// expected-error@-1 {{property type 'Int' does not match that of the 'wrappedValue' property of its wrapper type 'Wrapper1'}}
}
@propertyWrapper
struct Wrapper2 { // expected-note {{property wrapper type 'Wrapper2' declared here}}
var wrappedValue: Int??
}
class Test2 {
@Wrapper2 var user: Int?
// expected-error@-1 {{property type 'Int?' does not match that of the 'wrappedValue' property of its wrapper type 'Wrapper2'}}
}