Initial support for constraints formed by combining interfaces (#1307)

Add scaffolding for constraints in general, and support specifically constraints formed by applying a `&` operator.

No support for constraints formed with `where` nor for named constraints at this point.
This commit is contained in:
Richard Smith
2022-06-07 13:59:23 -07:00
committed by GitHub
parent 058b5e77c0
commit 1bb370420b
19 changed files with 822 additions and 201 deletions
@@ -15,7 +15,7 @@ interface Vector {
}
fn ScaleGeneric[T:! Vector](a: T, s: i32) -> T {
// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/interface/fail_interface_missing_member.carbon:[[@LINE+1]]: member access, Scale not in Vector
// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/interface/fail_interface_missing_member.carbon:[[@LINE+1]]: member access, Scale not in interface Vector
return a.Scale(s);
}