[Diagnostics] Improve the error message for when a type fails to satisfy

`AnyObject` layout requirement.
This commit is contained in:
Holly Borla
2019-10-18 11:27:21 -07:00
parent ec864fcd9c
commit 0d95a84e91
6 changed files with 21 additions and 10 deletions

View File

@@ -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()