| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814 |
- // 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
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/fail_abstract.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_abstract.carbon
- // --- fail_abstract_field.carbon
- library "[[@TEST_NAME]]";
- abstract class Abstract {
- }
- class Contains {
- // CHECK:STDERR: fail_abstract_field.carbon:[[@LINE+7]]:10: error: field has abstract type `Abstract` [AbstractTypeInFieldDecl]
- // CHECK:STDERR: var a: Abstract;
- // CHECK:STDERR: ^~~~~~~~
- // CHECK:STDERR: fail_abstract_field.carbon:[[@LINE-7]]:1: note: class was declared abstract here [ClassAbstractHere]
- // CHECK:STDERR: abstract class Abstract {
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- var a: Abstract;
- }
- // --- fail_abstract_var.carbon
- library "[[@TEST_NAME]]";
- abstract class Abstract {
- }
- fn Var() {
- // CHECK:STDERR: fail_abstract_var.carbon:[[@LINE+7]]:10: error: binding pattern has abstract type `Abstract` in `var` pattern [AbstractTypeInVarPattern]
- // CHECK:STDERR: var v: Abstract;
- // CHECK:STDERR: ^~~~~~~~
- // CHECK:STDERR: fail_abstract_var.carbon:[[@LINE-7]]:1: note: class was declared abstract here [ClassAbstractHere]
- // CHECK:STDERR: abstract class Abstract {
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- var v: Abstract;
- }
- // --- abstract_let.carbon
- library "[[@TEST_NAME]]";
- abstract class Abstract {
- }
- fn F(a: Abstract) {
- let l: Abstract = a;
- }
- // --- fail_abstract_adapter.carbon
- library "[[@TEST_NAME]]";
- abstract class Abstract {
- }
- class Adapter {
- // TODO(#4387): This should probably be valid
- // CHECK:STDERR: fail_abstract_adapter.carbon:[[@LINE+7]]:3: error: adapted type `Abstract` is an abstract type [AbstractTypeInAdaptDecl]
- // CHECK:STDERR: adapt Abstract;
- // CHECK:STDERR: ^~~~~~~~~~~~~~~
- // CHECK:STDERR: fail_abstract_adapter.carbon:[[@LINE-8]]:1: note: class was declared abstract here [ClassAbstractHere]
- // CHECK:STDERR: abstract class Abstract {
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- adapt Abstract;
- }
- // --- define_and_call_abstract_param.carbon
- library "[[@TEST_NAME]]";
- abstract class Abstract {
- }
- fn Param(a: Abstract);
- fn Call(p: Abstract) {
- Param(p);
- }
- // --- fail_todo_return_nonabstract_derived.carbon
- library "[[@TEST_NAME]]";
- abstract class Abstract {
- }
- class Derived {
- extend base: Abstract;
- var d: i32;
- }
- fn Make() -> Derived {
- // TODO: This should be valid, and should construct an instance of `partial Abstract` as the base.
- // CHECK:STDERR: fail_todo_return_nonabstract_derived.carbon:[[@LINE+7]]:10: error: initialization of abstract type `Abstract` [AbstractTypeInInit]
- // CHECK:STDERR: return {.base = {.a = 1}, .d = 7};
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR: fail_todo_return_nonabstract_derived.carbon:[[@LINE-14]]:1: note: class was declared abstract here [ClassAbstractHere]
- // CHECK:STDERR: abstract class Abstract {
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- return {.base = {.a = 1}, .d = 7};
- }
- // --- fail_return_abstract.carbon
- library "[[@TEST_NAME]]";
- abstract class Abstract {
- }
- class Derived {
- extend base: Abstract;
- var d: i32;
- }
- fn Return(a: Abstract) -> Abstract {
- // TODO: Seems like this would be better off failing with "function returns abstract type" here instead of this \/
- // CHECK:STDERR: fail_return_abstract.carbon:[[@LINE+7]]:3: error: initialization of abstract type `Abstract` [AbstractTypeInInit]
- // CHECK:STDERR: return a;
- // CHECK:STDERR: ^~~~~~~~~
- // CHECK:STDERR: fail_return_abstract.carbon:[[@LINE-14]]:1: note: class was declared abstract here [ClassAbstractHere]
- // CHECK:STDERR: abstract class Abstract {
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR:
- return a;
- }
- // --- access_abstract_subobject.carbon
- library "[[@TEST_NAME]]";
- abstract class Abstract {
- var a: i32;
- }
- class Derived {
- extend base: Abstract;
- var d: i32;
- }
- fn Access(d: Derived) -> i32 {
- return d.base.a;
- }
- // --- abstract_let_temporary.carbon
- library "[[@TEST_NAME]]";
- abstract class Abstract {
- }
- fn F() {
- let l: Abstract = {};
- }
- // --- fail_call_abstract_return.carbon
- library "[[@TEST_NAME]]";
- abstract class Abstract {
- }
- fn ReturnAbstract() -> Abstract;
- fn CallReturnAbstract() {
- // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE+10]]:3: error: function returns abstract type `Abstract` [AbstractTypeInFunctionReturnType]
- // CHECK:STDERR: ReturnAbstract();
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~
- // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE-9]]:1: note: class was declared abstract here [ClassAbstractHere]
- // CHECK:STDERR: abstract class Abstract {
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
- // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE-9]]:21: note: return type declared here [IncompleteReturnTypeHere]
- // CHECK:STDERR: fn ReturnAbstract() -> Abstract;
- // CHECK:STDERR: ^~~~~~~~~~~
- // CHECK:STDERR:
- ReturnAbstract();
- }
- // CHECK:STDOUT: --- fail_abstract_field.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %Contains: type = class_type @Contains [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .Abstract = %Abstract.decl
- // CHECK:STDOUT: .Contains = %Contains.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
- // CHECK:STDOUT: %Contains.decl: type = class_decl @Contains [template = constants.%Contains] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Abstract {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Abstract
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Contains {
- // CHECK:STDOUT: %.loc15_8: <error> = field_decl a, element0 [template]
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %.loc15_3: <error> = var_pattern %.loc15_8
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %.var: ref <error> = var <none>
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness <error> [template = <error>]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Contains
- // CHECK:STDOUT: .a = %.loc15_8
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_abstract_var.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %Var.type: type = fn_type @Var [template]
- // CHECK:STDOUT: %Var: %Var.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .Abstract = %Abstract.decl
- // CHECK:STDOUT: .Var = %Var.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
- // CHECK:STDOUT: %Var.decl: %Var.type = fn_decl @Var [template = constants.%Var] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Abstract {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Abstract
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Var() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %v.patt: <error> = binding_pattern v
- // CHECK:STDOUT: %.loc15: <error> = var_pattern %v.patt
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %v.var: ref <error> = var v
- // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
- // CHECK:STDOUT: %v: <error> = bind_name v, <error>
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- abstract_let.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %F.type: type = fn_type @F [template]
- // CHECK:STDOUT: %F: %F.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .Abstract = %Abstract.decl
- // CHECK:STDOUT: .F = %F.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
- // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
- // CHECK:STDOUT: %a.patt: %Abstract = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %Abstract = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %a.param: %Abstract = value_param runtime_param0
- // CHECK:STDOUT: %Abstract.ref.loc7: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
- // CHECK:STDOUT: %a: %Abstract = bind_name a, %a.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Abstract {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Abstract
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F(%a.param_patt: %Abstract) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %l.patt: %Abstract = binding_pattern l
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a.ref: %Abstract = name_ref a, %a
- // CHECK:STDOUT: %Abstract.ref.loc8: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
- // CHECK:STDOUT: %l: %Abstract = bind_name l, <error>
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_abstract_adapter.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %Adapter: type = class_type @Adapter [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .Abstract = %Abstract.decl
- // CHECK:STDOUT: .Adapter = %Adapter.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
- // CHECK:STDOUT: %Adapter.decl: type = class_decl @Adapter [template = constants.%Adapter] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Abstract {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Abstract
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Adapter {
- // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
- // CHECK:STDOUT: adapt_decl <error> [template]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness <error> [template = <error>]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Adapter
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- define_and_call_abstract_param.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %Param.type: type = fn_type @Param [template]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
- // CHECK:STDOUT: %Param: %Param.type = struct_value () [template]
- // CHECK:STDOUT: %Call.type: type = fn_type @Call [template]
- // CHECK:STDOUT: %Call: %Call.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .Abstract = %Abstract.decl
- // CHECK:STDOUT: .Param = %Param.decl
- // CHECK:STDOUT: .Call = %Call.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
- // CHECK:STDOUT: %Param.decl: %Param.type = fn_decl @Param [template = constants.%Param] {
- // CHECK:STDOUT: %a.patt: %Abstract = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %Abstract = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %a.param: %Abstract = value_param runtime_param0
- // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
- // CHECK:STDOUT: %a: %Abstract = bind_name a, %a.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] {
- // CHECK:STDOUT: %p.patt: %Abstract = binding_pattern p
- // CHECK:STDOUT: %p.param_patt: %Abstract = value_param_pattern %p.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %p.param: %Abstract = value_param runtime_param0
- // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
- // CHECK:STDOUT: %p: %Abstract = bind_name p, %p.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Abstract {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Abstract
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Param(%a.param_patt: %Abstract);
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Call(%p.param_patt: %Abstract) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Param.ref: %Param.type = name_ref Param, file.%Param.decl [template = constants.%Param]
- // CHECK:STDOUT: %p.ref: %Abstract = name_ref p, %p
- // CHECK:STDOUT: %Param.call: init %empty_tuple.type = call %Param.ref(<error>)
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_todo_return_nonabstract_derived.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %Derived: type = class_type @Derived [template]
- // CHECK:STDOUT: %Derived.elem.513: type = unbound_element_type %Derived, %Abstract [template]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %Derived.elem.344: type = unbound_element_type %Derived, %i32 [template]
- // CHECK:STDOUT: %struct_type.base.d.c44: type = struct_type {.base: %Abstract, .d: %i32} [template]
- // CHECK:STDOUT: %complete_type.32a: <witness> = complete_type_witness %struct_type.base.d.c44 [template]
- // CHECK:STDOUT: %Make.type: type = fn_type @Make [template]
- // CHECK:STDOUT: %Make: %Make.type = struct_value () [template]
- // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
- // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: Core.IntLiteral} [template]
- // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template]
- // CHECK:STDOUT: %struct_type.base.d.9c6: type = struct_type {.base: %struct_type.a, .d: Core.IntLiteral} [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .Int = %Core.Int
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .Abstract = %Abstract.decl
- // CHECK:STDOUT: .Derived = %Derived.decl
- // CHECK:STDOUT: .Make = %Make.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
- // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {}
- // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] {
- // CHECK:STDOUT: %return.patt: %Derived = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %Derived = out_param_pattern %return.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived]
- // CHECK:STDOUT: %return.param: ref %Derived = out_param runtime_param0
- // CHECK:STDOUT: %return: ref %Derived = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Abstract {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Abstract
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Derived {
- // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
- // CHECK:STDOUT: %.loc8: %Derived.elem.513 = base_decl %Abstract.ref, element0 [template]
- // CHECK:STDOUT: %.loc10_8: %Derived.elem.344 = field_decl d, element1 [template]
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %.loc10_3: %Derived.elem.344 = var_pattern %.loc10_8
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %.var: ref %Derived.elem.344 = var <none>
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base.d.c44 [template = constants.%complete_type.32a]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Derived
- // CHECK:STDOUT: .base = %.loc8
- // CHECK:STDOUT: .d = %.loc10_8
- // CHECK:STDOUT: extend %Abstract.ref
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Make() -> %return.param_patt: %Derived {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
- // CHECK:STDOUT: %.loc22_26: %struct_type.a = struct_literal (%int_1)
- // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7]
- // CHECK:STDOUT: %.loc22_35: %struct_type.base.d.9c6 = struct_literal (%.loc22_26, %int_7)
- // CHECK:STDOUT: return <error> to %return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_return_abstract.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %Derived: type = class_type @Derived [template]
- // CHECK:STDOUT: %Derived.elem.513: type = unbound_element_type %Derived, %Abstract [template]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %Derived.elem.344: type = unbound_element_type %Derived, %i32 [template]
- // CHECK:STDOUT: %struct_type.base.d: type = struct_type {.base: %Abstract, .d: %i32} [template]
- // CHECK:STDOUT: %complete_type.32a: <witness> = complete_type_witness %struct_type.base.d [template]
- // CHECK:STDOUT: %Return.type: type = fn_type @Return [template]
- // CHECK:STDOUT: %Return: %Return.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .Int = %Core.Int
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .Abstract = %Abstract.decl
- // CHECK:STDOUT: .Derived = %Derived.decl
- // CHECK:STDOUT: .Return = %Return.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
- // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {}
- // CHECK:STDOUT: %Return.decl: %Return.type = fn_decl @Return [template = constants.%Return] {
- // CHECK:STDOUT: %a.patt: %Abstract = binding_pattern a
- // CHECK:STDOUT: %a.param_patt: %Abstract = value_param_pattern %a.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %Abstract = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %Abstract = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %Abstract.ref.loc13_27: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
- // CHECK:STDOUT: %a.param: %Abstract = value_param runtime_param0
- // CHECK:STDOUT: %Abstract.ref.loc13_14: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
- // CHECK:STDOUT: %a: %Abstract = bind_name a, %a.param
- // CHECK:STDOUT: %return.param: ref %Abstract = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %Abstract = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Abstract {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Abstract
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Derived {
- // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
- // CHECK:STDOUT: %.loc8: %Derived.elem.513 = base_decl %Abstract.ref, element0 [template]
- // CHECK:STDOUT: %.loc10_8: %Derived.elem.344 = field_decl d, element1 [template]
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %.loc10_3: %Derived.elem.344 = var_pattern %.loc10_8
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %.var: ref %Derived.elem.344 = var <none>
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base.d [template = constants.%complete_type.32a]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Derived
- // CHECK:STDOUT: .base = %.loc8
- // CHECK:STDOUT: .d = %.loc10_8
- // CHECK:STDOUT: extend %Abstract.ref
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Return(%a.param_patt: %Abstract) -> %return.param_patt: %Abstract {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %a.ref: %Abstract = name_ref a, %a
- // CHECK:STDOUT: return <error> to %return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- access_abstract_subobject.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
- // CHECK:STDOUT: %Abstract.elem: type = unbound_element_type %Abstract, %i32 [template]
- // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template]
- // CHECK:STDOUT: %complete_type.fd7: <witness> = complete_type_witness %struct_type.a [template]
- // CHECK:STDOUT: %Derived: type = class_type @Derived [template]
- // CHECK:STDOUT: %Derived.elem.513: type = unbound_element_type %Derived, %Abstract [template]
- // CHECK:STDOUT: %Derived.elem.344: type = unbound_element_type %Derived, %i32 [template]
- // CHECK:STDOUT: %struct_type.base.d.c44: type = struct_type {.base: %Abstract, .d: %i32} [template]
- // CHECK:STDOUT: %complete_type.32a: <witness> = complete_type_witness %struct_type.base.d.c44 [template]
- // CHECK:STDOUT: %Access.type: type = fn_type @Access [template]
- // CHECK:STDOUT: %Access: %Access.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .Int = %Core.Int
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .Abstract = %Abstract.decl
- // CHECK:STDOUT: .Derived = %Derived.decl
- // CHECK:STDOUT: .Access = %Access.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
- // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {}
- // CHECK:STDOUT: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] {
- // CHECK:STDOUT: %d.patt: %Derived = binding_pattern d
- // CHECK:STDOUT: %d.param_patt: %Derived = value_param_pattern %d.patt, runtime_param0
- // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
- // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
- // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0
- // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived]
- // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param
- // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
- // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Abstract {
- // CHECK:STDOUT: %.loc5_8: %Abstract.elem = field_decl a, element0 [template]
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %.loc5_3: %Abstract.elem = var_pattern %.loc5_8
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %.var: ref %Abstract.elem = var <none>
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.a [template = constants.%complete_type.fd7]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Abstract
- // CHECK:STDOUT: .a = %.loc5_8
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Derived {
- // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
- // CHECK:STDOUT: %.loc9: %Derived.elem.513 = base_decl %Abstract.ref, element0 [template]
- // CHECK:STDOUT: %.loc11_8: %Derived.elem.344 = field_decl d, element1 [template]
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %.loc11_3: %Derived.elem.344 = var_pattern %.loc11_8
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %.var: ref %Derived.elem.344 = var <none>
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base.d.c44 [template = constants.%complete_type.32a]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Derived
- // CHECK:STDOUT: .base = %.loc9
- // CHECK:STDOUT: .d = %.loc11_8
- // CHECK:STDOUT: extend %Abstract.ref
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Access(%d.param_patt: %Derived) -> %i32 {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d
- // CHECK:STDOUT: %base.ref: %Derived.elem.513 = name_ref base, @Derived.%.loc9 [template = @Derived.%.loc9]
- // CHECK:STDOUT: %.loc15: ref %Abstract = class_element_access %d.ref, element0
- // CHECK:STDOUT: %a.ref: <error> = name_ref a, <error> [template = <error>]
- // CHECK:STDOUT: return <error>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- abstract_let_temporary.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %F.type: type = fn_type @F [template]
- // CHECK:STDOUT: %F: %F.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .Abstract = %Abstract.decl
- // CHECK:STDOUT: .F = %F.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
- // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Abstract {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Abstract
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @F() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %l.patt: %Abstract = binding_pattern l
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %.loc8: %empty_struct_type = struct_literal ()
- // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
- // CHECK:STDOUT: %l: %Abstract = bind_name l, <error>
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_call_abstract_return.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
- // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
- // CHECK:STDOUT: %ReturnAbstract.type: type = fn_type @ReturnAbstract [template]
- // CHECK:STDOUT: %ReturnAbstract: %ReturnAbstract.type = struct_value () [template]
- // CHECK:STDOUT: %CallReturnAbstract.type: type = fn_type @CallReturnAbstract [template]
- // CHECK:STDOUT: %CallReturnAbstract: %CallReturnAbstract.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .Abstract = %Abstract.decl
- // CHECK:STDOUT: .ReturnAbstract = %ReturnAbstract.decl
- // CHECK:STDOUT: .CallReturnAbstract = %CallReturnAbstract.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.import = import Core
- // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
- // CHECK:STDOUT: %ReturnAbstract.decl: %ReturnAbstract.type = fn_decl @ReturnAbstract [template = constants.%ReturnAbstract] {
- // CHECK:STDOUT: %return.patt: %Abstract = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: %Abstract = out_param_pattern %return.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
- // CHECK:STDOUT: %return.param: ref %Abstract = out_param runtime_param0
- // CHECK:STDOUT: %return: ref %Abstract = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %CallReturnAbstract.decl: %CallReturnAbstract.type = fn_decl @CallReturnAbstract [template = constants.%CallReturnAbstract] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Abstract {
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Abstract
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @ReturnAbstract() -> %Abstract;
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @CallReturnAbstract() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %ReturnAbstract.ref: %ReturnAbstract.type = name_ref ReturnAbstract, file.%ReturnAbstract.decl [template = constants.%ReturnAbstract]
- // CHECK:STDOUT: %ReturnAbstract.call: init <error> = call %ReturnAbstract.ref()
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|