@@ -125,6 +125,28 @@ fn NotEmptyStruct() {
125
125
EmptyStruct (C);
126
126
}
127
127
128
+ // --- fail_error_in_constraint.carbon
129
+
130
+ library "[[@TEST_NAME]]" ;
131
+
132
+ // @dump-sem-ir-begin
133
+ // CHECK:STDERR: fail_error_in_constraint.carbon:[[@LINE+4]]:41: error: name `I` not found [NameNotFound]
134
+ // CHECK:STDERR: fn WithError(U:! type where .Self impls I);
135
+ // CHECK:STDERR: ^
136
+ // CHECK:STDERR:
137
+ fn WithError (U:! type where .Self impls I);
138
+ // @dump-sem-ir-end
139
+
140
+ // --- import_error_in_constraint.carbon
141
+
142
+ library "[[@TEST_NAME]]" ;
143
+
144
+ import library "error_in_constraint" ;
145
+
146
+ fn F () {
147
+ WithError (());
148
+ }
149
+
128
150
// CHECK:STDOUT: --- state_constraints.carbon
129
151
// CHECK:STDOUT:
130
152
// CHECK:STDOUT: constants {
@@ -301,3 +323,36 @@ fn NotEmptyStruct() {
301
323
// CHECK:STDOUT: %W.loc12_24.2 => constants.%W
302
324
// CHECK:STDOUT: }
303
325
// CHECK:STDOUT:
326
+ // CHECK:STDOUT: --- fail_error_in_constraint.carbon
327
+ // CHECK:STDOUT:
328
+ // CHECK:STDOUT: constants {
329
+ // CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self]
330
+ // CHECK:STDOUT: %WithError.type: type = fn_type @WithError [concrete]
331
+ // CHECK:STDOUT: %WithError: %WithError.type = struct_value () [concrete]
332
+ // CHECK:STDOUT: }
333
+ // CHECK:STDOUT:
334
+ // CHECK:STDOUT: imports {
335
+ // CHECK:STDOUT: }
336
+ // CHECK:STDOUT:
337
+ // CHECK:STDOUT: file {
338
+ // CHECK:STDOUT: %WithError.decl: %WithError.type = fn_decl @WithError [concrete = constants.%WithError] {
339
+ // CHECK:STDOUT: %U.patt: <error> = symbolic_binding_pattern U, 0 [concrete]
340
+ // CHECK:STDOUT: } {
341
+ // CHECK:STDOUT: %.loc9_23.1: type = splice_block %.loc9_23.2 [concrete = <error>] {
342
+ // CHECK:STDOUT: <elided>
343
+ // CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
344
+ // CHECK:STDOUT: %I.ref: <error> = name_ref I, <error> [concrete = <error>]
345
+ // CHECK:STDOUT: %.loc9_23.2: type = where_expr %.Self [concrete = <error>] {
346
+ // CHECK:STDOUT: requirement_impls %.Self.ref, <error>
347
+ // CHECK:STDOUT: }
348
+ // CHECK:STDOUT: }
349
+ // CHECK:STDOUT: %U: <error> = bind_symbolic_name U, 0 [concrete = <error>]
350
+ // CHECK:STDOUT: }
351
+ // CHECK:STDOUT: }
352
+ // CHECK:STDOUT:
353
+ // CHECK:STDOUT: generic fn @WithError(%U: <error>) {
354
+ // CHECK:STDOUT: fn();
355
+ // CHECK:STDOUT: }
356
+ // CHECK:STDOUT:
357
+ // CHECK:STDOUT: specific @WithError(<error>) {}
358
+ // CHECK:STDOUT:
0 commit comments