mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Diagnostics] Improve the error message for when a type fails to satisfy
`AnyObject` layout requirement.
This commit is contained in:
@@ -16,7 +16,7 @@ class ProtoWithVersionedUnavailableMemberImpl: ProtoWithVersionedUnavailableMemb
|
||||
func testNonGeneric() {
|
||||
// CHECK-DIAGS-4:[[@LINE+1]]:{{[0-9]+}}: error: cannot convert value of type 'Any' to specified type 'Int'
|
||||
let _: Int = NewlyGenericSub.defaultElement()
|
||||
// CHECK-DIAGS-5:[[@LINE-1]]:{{[0-9]+}}: error: generic class 'NewlyGenericSub' requires that 'Int' conform to 'AnyObject'
|
||||
// CHECK-DIAGS-5:[[@LINE-1]]:{{[0-9]+}}: error: generic class 'NewlyGenericSub' requires that 'Int' be a class type
|
||||
|
||||
// CHECK-DIAGS-4:[[@LINE+1]]:{{[0-9]+}}: error: cannot specialize non-generic type 'NewlyGenericSub'
|
||||
let _: Int = NewlyGenericSub<Base>.defaultElement()
|
||||
|
||||
Reference in New Issue
Block a user