You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: toolchain/check/testdata/builtins/type/can_destroy.carbon
+22Lines changed: 22 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,28 @@ fn G() {
38
38
//@dump-sem-ir-end
39
39
}
40
40
41
+
// --- symbolic.carbon
42
+
library "[[@TEST_NAME]]";
43
+
44
+
interfaceZ {}
45
+
46
+
fnCanDestroy() ->type="type.can_destroy";
47
+
48
+
fnG(U:!CanDestroy()) {}
49
+
50
+
fnF(T:! Z &CanDestroy()) {
51
+
// Requires a conversion (and thus impl lookup into `T`) since `T` and `U`
52
+
// have different (but compatible) facet types.
53
+
// CHECK:STDERR: symbolic.carbon:[[@LINE+7]]:3: error: cannot convert type `T` that implements `Z where .Self impls Core.CanDestroy` into type implementing `type where .Self impls Core.CanDestroy` [ConversionFailureFacetToFacet]
0 commit comments