Files
carbon-lang/toolchain/check/testdata/interface/fail_assoc_const_not_binding.carbon
T
Richard Smith f5a3a9a7e0 Add Self into scope in interface definitions and using facets as types. (#3740)
`Self` is modeled as a `bind_symbolic_name` with no corresponding value,
for now at least. In the future it might make sense to model it as a new
kind of instruction, or as a `bind_symbolic_name` whose value is a
`param`, but for now we just want it to introduce a symbolic constant.

In order to convert a value like the `Self` of an interface to a type, a
new instruction `facet_type_access` is introduced. This notionally
accesses the "type" field within a facet, converting it from a pair of
(type, witness) into just the type.
2024-03-06 22:33:33 +00:00

28 lines
894 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
interface I {
// CHECK:STDERR: fail_assoc_const_not_binding.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `tuple pattern in let`.
// CHECK:STDERR: let (T:! type, U:! type);
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
let (T:! type, U:! type);
}
// CHECK:STDOUT: --- fail_assoc_const_not_binding.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = interface_type @I [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {}
// CHECK:STDOUT:
// CHECK:STDOUT: interface @I {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = <unexpected instref inst+3>
// CHECK:STDOUT: witness = invalid
// CHECK:STDOUT: }
// CHECK:STDOUT: