mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 18:38:33 +00:00
Also add `name_reference_untyped` for references to non-first-class names without types, which currently covers namespaces and functions. This improves the fidelity of the SemIR representation, and fixes some issues where we would use the wrong location for nodes and diagnostics downstream of a name reference. We're still missing a representation for dotted name expressions, such as `Namespace.Function`, and we don't use the `untyped` node as an operand of any other node yet.
24 lines
867 B
Plaintext
24 lines
867 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
|
|
|
|
// OK, `const (const i32)` is the same type as `const i32`.
|
|
// CHECK:STDERR: collapse.carbon:[[@LINE+3]]:25: `const` applied repeatedly to the same type has no additional effect.
|
|
// CHECK:STDERR: fn F(p: const i32**) -> const (const i32)** {
|
|
// CHECK:STDERR: ^
|
|
fn F(p: const i32**) -> const (const i32)** {
|
|
return p;
|
|
}
|
|
|
|
// CHECK:STDOUT: file "collapse.carbon" {
|
|
// CHECK:STDOUT: %F = fn_decl @F
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F(%p: const i32**) -> const i32** {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %p.ref: const i32** = name_reference "p", %p
|
|
// CHECK:STDOUT: return %p.ref
|
|
// CHECK:STDOUT: }
|