| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580 |
- // 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
- //
- // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
- // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
- // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/import_access.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/import_access.carbon
- // ============================================================================
- // Setup files
- // ============================================================================
- // --- def.carbon
- package Test library "[[@TEST_NAME]]";
- private class Def {}
- // --- forward_with_def.carbon
- package Test library "[[@TEST_NAME]]";
- private class ForwardWithDef;
- class ForwardWithDef {}
- // --- forward.carbon
- package Test library "[[@TEST_NAME]]";
- private class Forward;
- // ============================================================================
- // Test files
- // ============================================================================
- // --- def.impl.carbon
- impl package Test library "[[@TEST_NAME]]";
- var c: Def = {};
- // --- fail_local_def.carbon
- package Test library "[[@TEST_NAME]]";
- import library "def";
- // CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:8: error: name `Def` not found [NameNotFound]
- // CHECK:STDERR: var c: Def = {};
- // CHECK:STDERR: ^~~
- // CHECK:STDERR:
- var c: Def = {};
- // --- fail_other_def.carbon
- package Other library "[[@TEST_NAME]]";
- import Test library "def";
- // CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:8: error: member name `Def` not found in `Test` [MemberNameNotFoundInInstScope]
- // CHECK:STDERR: var c: Test.Def = {};
- // CHECK:STDERR: ^~~~~~~~
- // CHECK:STDERR:
- var c: Test.Def = {};
- // --- forward_with_def.impl.carbon
- impl package Test library "[[@TEST_NAME]]";
- var c: ForwardWithDef = {};
- // --- fail_local_forward_with_def.carbon
- package Test library "[[@TEST_NAME]]";
- import library "forward_with_def";
- // CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:8: error: name `ForwardWithDef` not found [NameNotFound]
- // CHECK:STDERR: var c: ForwardWithDef = {};
- // CHECK:STDERR: ^~~~~~~~~~~~~~
- // CHECK:STDERR:
- var c: ForwardWithDef = {};
- // --- fail_other_forward_with_def.carbon
- package Other library "[[@TEST_NAME]]";
- import Test library "forward_with_def";
- // CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:8: error: member name `ForwardWithDef` not found in `Test` [MemberNameNotFoundInInstScope]
- // CHECK:STDERR: var c: Test.ForwardWithDef = {};
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- var c: Test.ForwardWithDef = {};
- // --- forward.impl.carbon
- impl package Test library "[[@TEST_NAME]]";
- fn F(c: Forward*) {}
- class Forward {}
- // --- fail_local_forward.carbon
- package Test library "[[@TEST_NAME]]";
- import library "forward";
- // CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:9: error: name `Forward` not found [NameNotFound]
- // CHECK:STDERR: fn F(c: Forward*) {}
- // CHECK:STDERR: ^~~~~~~
- // CHECK:STDERR:
- fn F(c: Forward*) {}
- // --- fail_other_forward.carbon
- package Other library "[[@TEST_NAME]]";
- import Test library "forward";
- // CHECK:STDERR: fail_other_forward.carbon:[[@LINE+4]]:9: error: member name `Forward` not found in `Test` [MemberNameNotFoundInInstScope]
- // CHECK:STDERR: fn F(c: Test.Forward*) {}
- // CHECK:STDERR: ^~~~~~~~~~~~
- // CHECK:STDERR:
- fn F(c: Test.Forward*) {}
- // --- todo_fail_private_on_redecl.carbon
- library "[[@TEST_NAME]]";
- private class Redecl;
- private class Redecl {}
- // CHECK:STDOUT: --- def.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Def: type = class_type @Def [concrete]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Def [private] = %Def.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Def.decl: type = class_decl @Def [concrete = constants.%Def] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Def {
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Def
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- forward_with_def.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %ForwardWithDef: type = class_type @ForwardWithDef [concrete]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .ForwardWithDef [private] = %ForwardWithDef.decl.loc4
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %ForwardWithDef.decl.loc4: type = class_decl @ForwardWithDef [concrete = constants.%ForwardWithDef] {} {}
- // CHECK:STDOUT: %ForwardWithDef.decl.loc6: type = class_decl @ForwardWithDef [concrete = constants.%ForwardWithDef] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @ForwardWithDef {
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%ForwardWithDef
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- forward.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Forward: type = class_type @Forward [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Forward [private] = %Forward.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Forward.decl: type = class_decl @Forward [concrete = constants.%Forward] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Forward;
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- def.impl.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Def: type = class_type @Def [concrete]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %Def [concrete]
- // CHECK:STDOUT: %Def.val: %Def = struct_value () [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Test.Def: type = import_ref Test//def, Def, loaded [concrete = constants.%Def]
- // CHECK:STDOUT: %Test.import_ref.8f2: <witness> = import_ref Test//def, loc4_20, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Test.import_ref.4ce = import_ref Test//def, inst16 [no loc], unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Def [private] = imports.%Test.Def
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Test.import = import Test
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: %pattern_type = binding_pattern c [concrete]
- // CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref %Def = var %c.var_patt [concrete]
- // CHECK:STDOUT: %Def.ref: type = name_ref Def, imports.%Test.Def [concrete = constants.%Def]
- // CHECK:STDOUT: %c: ref %Def = bind_name c, %c.var [concrete = %c.var]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Def [from "def.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Test.import_ref.8f2
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Test.import_ref.4ce
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc4_15.1: %empty_struct_type = struct_literal ()
- // CHECK:STDOUT: %.loc4_15.2: init %Def = class_init (), file.%c.var [concrete = constants.%Def.val]
- // CHECK:STDOUT: %.loc4_1: init %Def = converted %.loc4_15.1, %.loc4_15.2 [concrete = constants.%Def.val]
- // CHECK:STDOUT: assign file.%c.var, %.loc4_1
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_local_def.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Def = <poisoned>
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: <error> = binding_pattern c [concrete]
- // CHECK:STDOUT: %c.var_patt: <error> = var_pattern %c.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref <error> = var %c.var_patt [concrete = <error>]
- // CHECK:STDOUT: %Def.ref: <error> = name_ref Def, <error> [concrete = <error>]
- // CHECK:STDOUT: %c: <error> = bind_name c, <error> [concrete = <error>]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc10: %empty_struct_type = struct_literal ()
- // CHECK:STDOUT: assign file.%c.var, <error>
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_other_def.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Test: <namespace> = namespace file.%Test.import, [concrete] {
- // CHECK:STDOUT: .Def = <poisoned>
- // CHECK:STDOUT: import Test//def
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Test = imports.%Test
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Test.import = import Test
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: <error> = binding_pattern c [concrete]
- // CHECK:STDOUT: %c.var_patt: <error> = var_pattern %c.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref <error> = var %c.var_patt [concrete = <error>]
- // CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
- // CHECK:STDOUT: %Test.ref: <namespace> = name_ref Test, imports.%Test [concrete = imports.%Test]
- // CHECK:STDOUT: %Def.ref: <error> = name_ref Def, <error> [concrete = <error>]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c: <error> = bind_name c, <error> [concrete = <error>]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc10: %empty_struct_type = struct_literal ()
- // CHECK:STDOUT: assign file.%c.var, <error>
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- forward_with_def.impl.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %ForwardWithDef: type = class_type @ForwardWithDef [concrete]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %ForwardWithDef [concrete]
- // CHECK:STDOUT: %ForwardWithDef.val: %ForwardWithDef = struct_value () [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Test.ForwardWithDef: type = import_ref Test//forward_with_def, ForwardWithDef, loaded [concrete = constants.%ForwardWithDef]
- // CHECK:STDOUT: %Test.import_ref.8f2: <witness> = import_ref Test//forward_with_def, loc6_23, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Test.import_ref.414 = import_ref Test//forward_with_def, inst16 [no loc], unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .ForwardWithDef [private] = imports.%Test.ForwardWithDef
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Test.import = import Test
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: %pattern_type = binding_pattern c [concrete]
- // CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref %ForwardWithDef = var %c.var_patt [concrete]
- // CHECK:STDOUT: %ForwardWithDef.ref: type = name_ref ForwardWithDef, imports.%Test.ForwardWithDef [concrete = constants.%ForwardWithDef]
- // CHECK:STDOUT: %c: ref %ForwardWithDef = bind_name c, %c.var [concrete = %c.var]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @ForwardWithDef [from "forward_with_def.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Test.import_ref.8f2
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Test.import_ref.414
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc4_26.1: %empty_struct_type = struct_literal ()
- // CHECK:STDOUT: %.loc4_26.2: init %ForwardWithDef = class_init (), file.%c.var [concrete = constants.%ForwardWithDef.val]
- // CHECK:STDOUT: %.loc4_1: init %ForwardWithDef = converted %.loc4_26.1, %.loc4_26.2 [concrete = constants.%ForwardWithDef.val]
- // CHECK:STDOUT: assign file.%c.var, %.loc4_1
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_local_forward_with_def.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .ForwardWithDef = <poisoned>
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: <error> = binding_pattern c [concrete]
- // CHECK:STDOUT: %c.var_patt: <error> = var_pattern %c.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref <error> = var %c.var_patt [concrete = <error>]
- // CHECK:STDOUT: %ForwardWithDef.ref: <error> = name_ref ForwardWithDef, <error> [concrete = <error>]
- // CHECK:STDOUT: %c: <error> = bind_name c, <error> [concrete = <error>]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc10: %empty_struct_type = struct_literal ()
- // CHECK:STDOUT: assign file.%c.var, <error>
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_other_forward_with_def.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Test: <namespace> = namespace file.%Test.import, [concrete] {
- // CHECK:STDOUT: .ForwardWithDef = <poisoned>
- // CHECK:STDOUT: import Test//forward_with_def
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Test = imports.%Test
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Test.import = import Test
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: <error> = binding_pattern c [concrete]
- // CHECK:STDOUT: %c.var_patt: <error> = var_pattern %c.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref <error> = var %c.var_patt [concrete = <error>]
- // CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
- // CHECK:STDOUT: %Test.ref: <namespace> = name_ref Test, imports.%Test [concrete = imports.%Test]
- // CHECK:STDOUT: %ForwardWithDef.ref: <error> = name_ref ForwardWithDef, <error> [concrete = <error>]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c: <error> = bind_name c, <error> [concrete = <error>]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc10: %empty_struct_type = struct_literal ()
- // CHECK:STDOUT: assign file.%c.var, <error>
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- forward.impl.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Forward: type = class_type @Forward [concrete]
- // CHECK:STDOUT: %ptr: type = ptr_type %Forward [concrete]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [concrete]
- // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
- // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Test.Forward: type = import_ref Test//forward, Forward, loaded [concrete = constants.%Forward]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Forward [private] = %Forward.decl
- // CHECK:STDOUT: .F = %F.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Test.import = import Test
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
- // CHECK:STDOUT: %c.patt: %pattern_type = binding_pattern c [concrete]
- // CHECK:STDOUT: %c.param_patt: %pattern_type = value_param_pattern %c.patt, call_param0 [concrete]
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %c.param: %ptr = value_param call_param0
- // CHECK:STDOUT: %.loc4: type = splice_block %ptr [concrete = constants.%ptr] {
- // CHECK:STDOUT: %Forward.ref: type = name_ref Forward, imports.%Test.Forward [concrete = constants.%Forward]
- // CHECK:STDOUT: %ptr: type = ptr_type %Forward.ref [concrete = constants.%ptr]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c: %ptr = bind_name c, %c.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Forward.decl: type = class_decl @Forward [concrete = constants.%Forward] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Forward {
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Forward
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F(%c.param: %ptr) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_local_forward.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
- // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Forward = <poisoned>
- // CHECK:STDOUT: .F = %F.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
- // CHECK:STDOUT: %c.patt: <error> = binding_pattern c [concrete]
- // CHECK:STDOUT: %c.param_patt: <error> = value_param_pattern %c.patt, call_param0 [concrete]
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %c.param: <error> = value_param call_param0
- // CHECK:STDOUT: %.loc10: type = splice_block %ptr [concrete = <error>] {
- // CHECK:STDOUT: %Forward.ref: <error> = name_ref Forward, <error> [concrete = <error>]
- // CHECK:STDOUT: %ptr: type = ptr_type <error> [concrete = <error>]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c: <error> = bind_name c, %c.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F(%c.param: <error>) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_other_forward.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
- // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Test: <namespace> = namespace file.%Test.import, [concrete] {
- // CHECK:STDOUT: .Forward = <poisoned>
- // CHECK:STDOUT: import Test//forward
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Test = imports.%Test
- // CHECK:STDOUT: .F = %F.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Test.import = import Test
- // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
- // CHECK:STDOUT: %c.patt: <error> = binding_pattern c [concrete]
- // CHECK:STDOUT: %c.param_patt: <error> = value_param_pattern %c.patt, call_param0 [concrete]
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %c.param: <error> = value_param call_param0
- // CHECK:STDOUT: %.loc10: type = splice_block %ptr [concrete = <error>] {
- // CHECK:STDOUT: %Test.ref: <namespace> = name_ref Test, imports.%Test [concrete = imports.%Test]
- // CHECK:STDOUT: %Forward.ref: <error> = name_ref Forward, <error> [concrete = <error>]
- // CHECK:STDOUT: %ptr: type = ptr_type <error> [concrete = <error>]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c: <error> = bind_name c, %c.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F(%c.param: <error>) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- todo_fail_private_on_redecl.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Redecl: type = class_type @Redecl [concrete]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Redecl [private] = %Redecl.decl.loc4
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Redecl.decl.loc4: type = class_decl @Redecl [concrete = constants.%Redecl] {} {}
- // CHECK:STDOUT: %Redecl.decl.loc6: type = class_decl @Redecl [concrete = constants.%Redecl] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Redecl {
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Redecl
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|