mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 20:28:12 +00:00
Part of switching to the [abbreviations we've decided to use](https://docs.google.com/document/d/1RRYMm42osyqhI2LyjrjockYCutQ5dOf8Abu50kTrkX0/edit?resourcekey=0-kHyqOESbOHmzZphUbtLrTw#heading=h.pph7i5m5un7q). I will rename files in a follow-up PR.
47 lines
2.1 KiB
Plaintext
47 lines
2.1 KiB
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
|
|
|
|
class Incomplete;
|
|
|
|
// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:24: ERROR: Variable has incomplete type `(i32, Incomplete)`.
|
|
// CHECK:STDERR: var t: (i32, Incomplete);
|
|
// CHECK:STDERR: ^
|
|
// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: Class was forward declared here.
|
|
// CHECK:STDERR: class Incomplete;
|
|
// CHECK:STDERR: ^
|
|
var t: (i32, Incomplete);
|
|
|
|
// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+3]]:27: ERROR: Cannot implicitly convert from `<error>*` to `Incomplete*`.
|
|
// CHECK:STDERR: var p: Incomplete* = &t[1];
|
|
// CHECK:STDERR: ^
|
|
var p: Incomplete* = &t[1];
|
|
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %.loc15_24.1: type = tuple_type (type, type)
|
|
// CHECK:STDOUT: %.loc15_24.2: type = tuple_type (i32, Incomplete)
|
|
// CHECK:STDOUT: %.loc20: type = ptr_type <error>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file "fail_nested_incomplete.carbon" {
|
|
// CHECK:STDOUT: class_decl @Incomplete, ()
|
|
// CHECK:STDOUT: %Incomplete: type = class_type @Incomplete
|
|
// CHECK:STDOUT: %Incomplete.ref.loc15: type = name_reference Incomplete, %Incomplete
|
|
// CHECK:STDOUT: %.loc15_24.1: (type, type) = tuple_literal (i32, %Incomplete.ref.loc15)
|
|
// CHECK:STDOUT: %.loc15_24.2: type = converted %.loc15_24.1, constants.%.loc15_24.2
|
|
// CHECK:STDOUT: %t.var: ref <error> = var t
|
|
// CHECK:STDOUT: %t: ref <error> = bind_name t, %t.var
|
|
// CHECK:STDOUT: %Incomplete.ref.loc20: type = name_reference Incomplete, %Incomplete
|
|
// CHECK:STDOUT: %.loc20_18: type = ptr_type Incomplete
|
|
// CHECK:STDOUT: %p.var: ref Incomplete* = var p
|
|
// CHECK:STDOUT: %p: ref Incomplete* = bind_name p, %p.var
|
|
// CHECK:STDOUT: %t.ref: ref <error> = name_reference t, %t
|
|
// CHECK:STDOUT: %.loc20_25: i32 = int_literal 1
|
|
// CHECK:STDOUT: %.loc20_22: <error>* = address_of <error>
|
|
// CHECK:STDOUT: assign %p.var, <error>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Incomplete;
|