Implement support for rewrite constraints (#2276)

Implements basic support for rewrite constraints as proposed in #2173.

Support for associated constants and complex constraints in general is also made more robust: argument deduction now properly computes and substitutes witnesses, and interface declarations track a more correct description of the constraint that they introduce than the one we previously built.
This commit is contained in:
Richard Smith
2022-10-12 12:55:55 -07:00
committed by GitHub
parent 9feff92f22
commit 9f534ae004
29 changed files with 1386 additions and 455 deletions
@@ -13,7 +13,6 @@ fn id[T:! Type](x: i32) -> i32 {
}
fn Main() -> i32 {
// CHECK:COMPILATION ERROR: {{.*}}/explorer/testdata/generic_function/fail_type_deduction_unused.carbon:[[@LINE+2]]: could not deduce type argument for type parameter T
// CHECK:in id(0)
// CHECK:COMPILATION ERROR: {{.*}}/explorer/testdata/generic_function/fail_type_deduction_unused.carbon:[[@LINE+1]]: could not deduce type argument for type parameter T in call
return id(0);
}