Files
carbon-lang/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon
T
Richard Smith 71aa4a45be Distinguish between name IDs and string IDs in the type system. (#3341)
Add a `NameId` that is effectively just a wrapper around a `StringId`,
with
some additional predefined values for names that don't correspond to
strings, such as the name of `self` or the function's return slot.
2023-11-09 16:51:36 +00:00

21 lines
805 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
var x: i32;
// CHECK:STDERR: fail_qualifier_unsupported.carbon:[[@LINE+3]]:15: ERROR: Type `i32` does not support qualified expressions.
// CHECK:STDERR: var y: i32 = x.b;
// CHECK:STDERR: ^
var y: i32 = x.b;
// CHECK:STDOUT: file "fail_qualifier_unsupported.carbon" {
// CHECK:STDOUT: %x.var: ref i32 = var x
// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var
// CHECK:STDOUT: %y.var: ref i32 = var y
// CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var
// CHECK:STDOUT: %x.ref: ref i32 = name_reference x, %x
// CHECK:STDOUT: assign %y.var, <error>
// CHECK:STDOUT: }