Files
carbon-lang/explorer/testdata/assoc_const/fail_overspecified_impl.carbon
T
Richard Smith adc78fbdb0 Defer resolving rewrites until we apply a constraint to a binding (#2333)
Instead of checking and resolving rewrites eagerly, defer doing so until a constraint is applied to a binding. Actual resolution of rewrites is not yet implemented, so this is mostly just refactoring, but the eventual goal is to support things like `(Constraint where .T = .U) & (Constraint where .U = V)` (however they are reached) by applying one rewrite to the other, as agreed with @josh11b in discussion of #2173.

One nice consequence is that substitution into a constraint type no longer has a failure path, so substitution is once again not able to fail.
2022-10-24 15:50:31 -07:00

21 lines
664 B
Plaintext

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// AUTOUPDATE
// RUN: %{not} %{explorer-run}
// RUN: %{not} %{explorer-run-trace}
package ExplorerTest api;
interface HasType {
let T:! Type;
}
// CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/assoc_const/fail_overspecified_impl.carbon:[[@LINE+3]]: multiple different rewrites for `(i32).(HasType.T)`:
// CHECK:STDERR: i32
// CHECK:STDERR: {.a: i32}
external impl i32 as HasType where .T = i32 and .T = {.a: i32} {}
fn Main() -> i32 { return 0; }