mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 09:24:46 +01:00
Parse vars in classes the same as vars in other locations (#7188)
Class vars are still restricted to simple `name: type` bindings, not full patterns. This is now handled in the check phase instead of during parsing. This is in preparation for supporting `static var`.
This commit is contained in:
@@ -40,6 +40,9 @@ class FullPatternStack {
|
||||
// A name-binding declaration, such as a `let` or `var` statement.
|
||||
NameBindingDecl,
|
||||
|
||||
// A non-static `var` field declaration inside a class.
|
||||
FieldDecl,
|
||||
|
||||
// The implicit parameter list of a function or impl declaration.
|
||||
ImplicitParamList,
|
||||
|
||||
@@ -62,6 +65,12 @@ class FullPatternStack {
|
||||
// The kind of the current full-pattern.
|
||||
auto CurrentKind() const -> Kind { return kind_stack_.back(); }
|
||||
|
||||
// Whether the kind of the current full-pattern is a non-static class
|
||||
// `var` decl.
|
||||
auto IsCurrentKindFieldDecl() -> bool {
|
||||
return !empty() && CurrentKind() == Kind::FieldDecl;
|
||||
}
|
||||
|
||||
// Marks the start of a new full-pattern for a parameterized entity
|
||||
// declaration, such as a function or impl. The kind is initially
|
||||
// NotInEitherParamList.
|
||||
@@ -76,6 +85,13 @@ class FullPatternStack {
|
||||
bind_name_stack_.PushArray();
|
||||
}
|
||||
|
||||
// Marks the start of a new full-pattern for a non-staitc `var` field
|
||||
// declaration.
|
||||
auto PushFieldDecl() -> void {
|
||||
kind_stack_.push_back(Kind::FieldDecl);
|
||||
bind_name_stack_.PushArray();
|
||||
}
|
||||
|
||||
// Marks the start of the current parameterized entity's implicit parameter
|
||||
// list.
|
||||
auto StartImplicitParamList() -> void {
|
||||
|
||||
@@ -339,7 +339,8 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
|
||||
break;
|
||||
}
|
||||
|
||||
case FullPatternStack::Kind::NameBindingDecl: {
|
||||
case FullPatternStack::Kind::NameBindingDecl:
|
||||
case FullPatternStack::Kind::FieldDecl: {
|
||||
if (node_kind == Parse::NodeKind::FormBindingPattern) {
|
||||
return context.TODO(node_id, "support local form bindings");
|
||||
}
|
||||
@@ -487,54 +488,6 @@ auto HandleParseNode(Context& context,
|
||||
return true;
|
||||
}
|
||||
|
||||
auto HandleParseNode(Context& context, Parse::FieldNameAndTypeId node_id)
|
||||
-> bool {
|
||||
auto [type_node, parsed_type_id] = context.node_stack().PopExprWithNodeId();
|
||||
auto [cast_type_inst_id, cast_type_id] =
|
||||
ExprAsType(context, type_node, parsed_type_id);
|
||||
auto [name_node, name_id] = context.node_stack().PopNameWithNodeId();
|
||||
|
||||
auto parent_class_decl =
|
||||
context.scope_stack().TryGetCurrentScopeAs<SemIR::ClassDecl>();
|
||||
CARBON_CHECK(parent_class_decl);
|
||||
if (!RequireConcreteType(
|
||||
context, cast_type_id, type_node,
|
||||
[&](auto& builder) {
|
||||
CARBON_DIAGNOSTIC(IncompleteTypeInFieldDecl, Context,
|
||||
"field has incomplete type {0}", SemIR::TypeId);
|
||||
builder.Context(type_node, IncompleteTypeInFieldDecl, cast_type_id);
|
||||
},
|
||||
[&](auto& builder) {
|
||||
CARBON_DIAGNOSTIC(AbstractTypeInFieldDecl, Context,
|
||||
"field has abstract type {0}", SemIR::TypeId);
|
||||
builder.Context(type_node, AbstractTypeInFieldDecl, cast_type_id);
|
||||
})) {
|
||||
cast_type_id = SemIR::ErrorInst::TypeId;
|
||||
}
|
||||
if (cast_type_id == SemIR::ErrorInst::TypeId) {
|
||||
cast_type_inst_id = SemIR::ErrorInst::TypeInstId;
|
||||
}
|
||||
auto& class_info = context.classes().Get(parent_class_decl->class_id);
|
||||
auto field_type_id = GetUnboundElementType(
|
||||
context, context.types().GetTypeInstId(class_info.self_type_id),
|
||||
cast_type_inst_id);
|
||||
auto field_id =
|
||||
AddInst<SemIR::FieldDecl>(context, node_id,
|
||||
{.type_id = field_type_id,
|
||||
.name_id = name_id,
|
||||
.index = SemIR::ElementIndex::None});
|
||||
context.field_decls_stack().AppendToTop(field_id);
|
||||
|
||||
auto name_context =
|
||||
context.decl_name_stack().MakeUnqualifiedName(node_id, name_id);
|
||||
context.decl_name_stack().AddNameOrDiagnose(
|
||||
name_context, field_id,
|
||||
context.decl_introducer_state_stack()
|
||||
.innermost()
|
||||
.modifier_set.GetAccessKind());
|
||||
return true;
|
||||
}
|
||||
|
||||
auto HandleParseNode(Context& context, Parse::RefBindingNameId node_id)
|
||||
-> bool {
|
||||
context.node_stack().Push(node_id);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <optional>
|
||||
|
||||
#include "toolchain/check/call.h"
|
||||
#include "toolchain/check/class.h"
|
||||
#include "toolchain/check/context.h"
|
||||
#include "toolchain/check/convert.h"
|
||||
#include "toolchain/check/core_identifier.h"
|
||||
@@ -18,6 +19,7 @@
|
||||
#include "toolchain/check/name_lookup.h"
|
||||
#include "toolchain/check/pattern.h"
|
||||
#include "toolchain/check/pattern_match.h"
|
||||
#include "toolchain/check/type.h"
|
||||
#include "toolchain/diagnostics/emitter.h"
|
||||
#include "toolchain/diagnostics/format_providers.h"
|
||||
#include "toolchain/lex/token_kind.h"
|
||||
@@ -66,7 +68,12 @@ static auto HandleIntroducer(Context& context, Parse::NodeId node_id) -> bool {
|
||||
// Push a bracketing node and pattern block to establish the pattern context.
|
||||
context.node_stack().Push(node_id);
|
||||
context.pattern_block_stack().Push();
|
||||
context.full_pattern_stack().PushNameBindingDecl();
|
||||
if (context.scope_stack().TryGetCurrentScopeAs<SemIR::ClassDecl>() &&
|
||||
Kind == Lex::TokenKind::Var) {
|
||||
context.full_pattern_stack().PushFieldDecl();
|
||||
} else {
|
||||
context.full_pattern_stack().PushNameBindingDecl();
|
||||
}
|
||||
BeginSubpattern(context);
|
||||
return true;
|
||||
}
|
||||
@@ -88,13 +95,6 @@ auto HandleParseNode(Context& context, Parse::VariableIntroducerId node_id)
|
||||
return HandleIntroducer<Lex::TokenKind::Var>(context, node_id);
|
||||
}
|
||||
|
||||
auto HandleParseNode(Context& context, Parse::FieldIntroducerId node_id)
|
||||
-> bool {
|
||||
context.decl_introducer_state_stack().Push<Lex::TokenKind::Var>();
|
||||
context.node_stack().Push(node_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
auto HandleParseNode(Context& context, Parse::VariablePatternId node_id)
|
||||
-> bool {
|
||||
auto subpattern_id = context.node_stack().PopPattern();
|
||||
@@ -120,6 +120,10 @@ auto HandleParseNode(Context& context, Parse::VariablePatternId node_id)
|
||||
context, node_id,
|
||||
{.type_id = type_id, .subpattern_id = subpattern_id});
|
||||
break;
|
||||
case FullPatternStack::Kind::FieldDecl:
|
||||
// For class fields, a `FieldDecl` has already been created; do
|
||||
// not create a var pattern.
|
||||
return true;
|
||||
case FullPatternStack::Kind::NotInEitherParamList:
|
||||
CARBON_FATAL("Unreachable");
|
||||
}
|
||||
@@ -141,6 +145,13 @@ static auto EndFullPattern(Context& context) -> void {
|
||||
return;
|
||||
}
|
||||
auto pattern_block_id = context.pattern_block_stack().Pop();
|
||||
|
||||
// For class fields, a `FieldDecl` has been created; skip creating a
|
||||
// name binding and var storage.
|
||||
if (context.full_pattern_stack().IsCurrentKindFieldDecl()) {
|
||||
return;
|
||||
}
|
||||
|
||||
AddInst<SemIR::NameBindingDecl>(context, context.node_stack().PeekNodeId(),
|
||||
{.pattern_block_id = pattern_block_id});
|
||||
|
||||
@@ -191,13 +202,12 @@ auto HandleParseNode(Context& context,
|
||||
|
||||
auto HandleParseNode(Context& context, Parse::VariableInitializerId node_id)
|
||||
-> bool {
|
||||
return HandleInitializer(context, node_id);
|
||||
}
|
||||
if (context.full_pattern_stack().IsCurrentKindFieldDecl()) {
|
||||
context.TODO(node_id, "Field initializer");
|
||||
return false;
|
||||
}
|
||||
|
||||
auto HandleParseNode(Context& context, Parse::FieldInitializerId node_id)
|
||||
-> bool {
|
||||
context.node_stack().Push(node_id);
|
||||
return true;
|
||||
return HandleInitializer(context, node_id);
|
||||
}
|
||||
|
||||
// Make a default initialization expression for a `var` declaration.
|
||||
@@ -249,6 +259,7 @@ template <const Lex::TokenKind& IntroducerTokenKind,
|
||||
const Parse::NodeKind& InitializerNodeKind>
|
||||
static auto HandleDecl(Context& context, Parse::NodeId node_id) -> DeclInfo {
|
||||
DeclInfo decl_info = DeclInfo();
|
||||
bool is_field_decl = context.full_pattern_stack().IsCurrentKindFieldDecl();
|
||||
|
||||
// Handle the optional initializer.
|
||||
if (context.node_stack().PeekNextIs(InitializerNodeKind)) {
|
||||
@@ -268,18 +279,22 @@ static auto HandleDecl(Context& context, Parse::NodeId node_id) -> DeclInfo {
|
||||
EndAssociatedConstantDeclRegion(context, interface_decl.interface_id);
|
||||
}
|
||||
|
||||
// A variable declaration without an explicit initializer is initialized by
|
||||
// calling `(T as Core.DefaultOrUnformed).Op()`.
|
||||
if constexpr (IntroducerNodeKind == Parse::NodeKind::VariableIntroducer) {
|
||||
StartPatternInitializer(context);
|
||||
decl_info.init_id =
|
||||
MakeDefaultInit(context, node_id, context.node_stack().PeekPattern());
|
||||
EndPatternInitializer(context);
|
||||
// A non-class variable declaration without an explicit initializer
|
||||
// is initialized by calling `(T as Core.DefaultOrUnformed).Op()`.
|
||||
if (!is_field_decl) {
|
||||
if constexpr (IntroducerNodeKind == Parse::NodeKind::VariableIntroducer) {
|
||||
StartPatternInitializer(context);
|
||||
decl_info.init_id = MakeDefaultInit(context, node_id,
|
||||
context.node_stack().PeekPattern());
|
||||
EndPatternInitializer(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
context.full_pattern_stack().PopFullPattern();
|
||||
|
||||
decl_info.pattern_id = context.node_stack().PopPattern();
|
||||
if (!is_field_decl) {
|
||||
decl_info.pattern_id = context.node_stack().PopPattern();
|
||||
}
|
||||
|
||||
context.node_stack().PopAndDiscardSoloNodeId<IntroducerNodeKind>();
|
||||
|
||||
@@ -386,31 +401,12 @@ auto HandleParseNode(Context& context, Parse::VariableDeclId node_id) -> bool {
|
||||
context, decl_info.introducer,
|
||||
KeywordModifierSet::Access | KeywordModifierSet::Returned);
|
||||
|
||||
if (context.scope_stack().TryGetCurrentScopeAs<SemIR::ClassDecl>()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
LocalPatternMatch(context, decl_info.pattern_id, decl_info.init_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
auto HandleParseNode(Context& context, Parse::FieldDeclId node_id) -> bool {
|
||||
if (context.node_stack().PeekNextIs(Parse::NodeKind::FieldInitializer)) {
|
||||
// TODO: In a class scope, we should instead save the initializer
|
||||
// somewhere so that we can use it as a default.
|
||||
context.TODO(node_id, "Field initializer");
|
||||
context.node_stack().PopExpr();
|
||||
context.node_stack()
|
||||
.PopAndDiscardSoloNodeId<Parse::NodeKind::FieldInitializer>();
|
||||
}
|
||||
|
||||
context.node_stack()
|
||||
.PopAndDiscardSoloNodeId<Parse::NodeKind::FieldIntroducer>();
|
||||
auto parent_scope_inst =
|
||||
context.name_scopes()
|
||||
.GetInstIfValid(context.scope_stack().PeekNameScopeId())
|
||||
.second;
|
||||
auto introducer =
|
||||
context.decl_introducer_state_stack().Pop<Lex::TokenKind::Var>();
|
||||
CheckAccessModifiersOnDecl(context, introducer, parent_scope_inst);
|
||||
LimitModifiersOnDecl(context, introducer, KeywordModifierSet::Access);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Carbon::Check
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "toolchain/check/inst.h"
|
||||
#include "toolchain/check/pattern.h"
|
||||
#include "toolchain/check/type.h"
|
||||
#include "toolchain/diagnostics/emitter.h"
|
||||
|
||||
namespace Carbon::Check {
|
||||
|
||||
@@ -95,6 +96,15 @@ auto HandleParseNode(Context& context, Parse::TuplePatternId node_id) -> bool {
|
||||
llvm::SmallVector<SemIR::InstId> type_inst_ids;
|
||||
type_inst_ids.reserve(inst_block.size());
|
||||
for (auto inst : inst_block) {
|
||||
if (context.full_pattern_stack().IsCurrentKindFieldDecl()) {
|
||||
CARBON_DIAGNOSTIC(FieldWithTuplePattern, Error,
|
||||
"found tuple pattern in class `var` decl");
|
||||
context.emitter().Emit(LocIdForDiagnostics::TokenOnly(node_id),
|
||||
FieldWithTuplePattern);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
auto type_id = ExtractScrutineeType(context.sem_ir(),
|
||||
context.insts().Get(inst).type_id());
|
||||
type_inst_ids.push_back(context.types().GetTypeInstId(type_id));
|
||||
|
||||
@@ -414,7 +414,6 @@ class NodeStack {
|
||||
-> std::optional<Id::Kind> {
|
||||
switch (node_kind) {
|
||||
case Parse::NodeKind::CallExprStart:
|
||||
case Parse::NodeKind::FieldNameAndType:
|
||||
case Parse::NodeKind::IfExprThen:
|
||||
case Parse::NodeKind::RequireIntroducer:
|
||||
case Parse::NodeKind::ShortCircuitOperandAnd:
|
||||
@@ -454,8 +453,6 @@ class NodeStack {
|
||||
case Parse::NodeKind::ClassIntroducer:
|
||||
case Parse::NodeKind::CodeBlockStart:
|
||||
case Parse::NodeKind::ExplicitParamListStart:
|
||||
case Parse::NodeKind::FieldInitializer:
|
||||
case Parse::NodeKind::FieldIntroducer:
|
||||
case Parse::NodeKind::ForHeaderStart:
|
||||
case Parse::NodeKind::FunctionIntroducer:
|
||||
case Parse::NodeKind::IfStatementElse:
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
|
||||
#include "toolchain/base/kind_switch.h"
|
||||
#include "toolchain/check/action.h"
|
||||
#include "toolchain/check/class.h"
|
||||
#include "toolchain/check/control_flow.h"
|
||||
#include "toolchain/check/inst.h"
|
||||
#include "toolchain/check/return.h"
|
||||
#include "toolchain/check/type.h"
|
||||
#include "toolchain/diagnostics/emitter.h"
|
||||
#include "toolchain/sem_ir/inst.h"
|
||||
|
||||
namespace Carbon::Check {
|
||||
@@ -134,6 +136,32 @@ auto AddBindingPattern(Context& context, SemIR::LocId name_loc,
|
||||
}
|
||||
auto type_id = SemIR::ExtractScrutineeType(context.sem_ir(), pattern.type_id);
|
||||
|
||||
// Handle `var` decls in a class by creating a `FieldDecl`.
|
||||
if (context.full_pattern_stack().IsCurrentKindFieldDecl()) {
|
||||
auto class_decl =
|
||||
context.scope_stack().TryGetCurrentScopeAs<SemIR::ClassDecl>();
|
||||
auto name_id = context.entity_names().Get(pattern.entity_name_id).name_id;
|
||||
auto& class_info = context.classes().Get(class_decl->class_id);
|
||||
auto field_type_id = GetUnboundElementType(
|
||||
context, context.types().GetTypeInstId(class_info.self_type_id),
|
||||
context.types().GetTypeInstId(type_id));
|
||||
|
||||
if (name_id == SemIR::NameId::Underscore) {
|
||||
CARBON_DIAGNOSTIC(FieldNamedUnderscore, Error,
|
||||
"expected identifier in field declaration");
|
||||
context.emitter().Emit(name_loc, FieldNamedUnderscore);
|
||||
}
|
||||
|
||||
auto field_id =
|
||||
AddInst<SemIR::FieldDecl>(context, name_loc,
|
||||
{.type_id = field_type_id,
|
||||
.name_id = name_id,
|
||||
.index = SemIR::ElementIndex::None});
|
||||
context.field_decls_stack().AppendToTop(field_id);
|
||||
|
||||
return {.pattern_id = field_id, .bind_id = field_id};
|
||||
}
|
||||
|
||||
auto bind_id = AddInstInNoBlock(
|
||||
context, SemIR::LocIdAndInst::RuntimeVerified(
|
||||
context.sem_ir(), name_loc,
|
||||
|
||||
+2
-5
@@ -38,7 +38,6 @@ var a_val: a = {.v = b_val.v};
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %struct_type.v: type = struct_type {.v: %empty_tuple.type} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.v [concrete]
|
||||
@@ -64,15 +63,13 @@ var a_val: a = {.v = b_val.v};
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %.loc4_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc4_19.2: type = converted %.loc4_19.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc4_16: %C.elem = field_decl v, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc4: %C.elem = field_decl v, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.v [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: .v = %.loc4_16
|
||||
// CHECK:STDOUT: .v = %.loc4
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- b.carbon
|
||||
|
||||
+18
-28
@@ -19,7 +19,7 @@ abstract class Abstract {
|
||||
}
|
||||
|
||||
class Contains {
|
||||
// CHECK:STDERR: fail_abstract_field.carbon:[[@LINE+7]]:10: error: field has abstract type `Abstract` [AbstractTypeInFieldDecl]
|
||||
// CHECK:STDERR: fail_abstract_field.carbon:[[@LINE+7]]:10: error: binding pattern has abstract type `Abstract` in `var` pattern [AbstractTypeInVarPattern]
|
||||
// CHECK:STDERR: var a: Abstract;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_abstract_field.carbon:[[@LINE-7]]:1: note: class was declared abstract here [ClassAbstractHere]
|
||||
@@ -265,7 +265,6 @@ fn CallReturnAbstract() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Contains {
|
||||
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [concrete = constants.%Abstract]
|
||||
// CHECK:STDOUT: %.loc14: <error> = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -556,7 +555,7 @@ fn CallReturnAbstract() {
|
||||
// CHECK:STDOUT: %struct_type.base.d.be5: type = struct_type {.base: %Abstract, .d: %empty_struct_type} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.840: <witness> = complete_type_witness %struct_type.base.d.be5 [concrete]
|
||||
// CHECK:STDOUT: %.d9b: Core.Form = init_form %Derived [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %Derived [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.9f6: type = pattern_type %Derived [concrete]
|
||||
// CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete]
|
||||
// CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %struct_type.base.d.e0f: type = struct_type {.base: %empty_struct_type, .d: %empty_struct_type} [concrete]
|
||||
@@ -585,8 +584,8 @@ fn CallReturnAbstract() {
|
||||
// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [concrete = constants.%Abstract] {} {}
|
||||
// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [concrete = constants.%Derived] {} {}
|
||||
// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [concrete = constants.%Make] {
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern %return.param_patt, %Derived.ref [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.9f6 = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.9f6 = return_slot_pattern %return.param_patt, %Derived.ref [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived]
|
||||
// CHECK:STDOUT: %.loc12: Core.Form = init_form %Derived.ref [concrete = constants.%.d9b]
|
||||
@@ -606,9 +605,7 @@ fn CallReturnAbstract() {
|
||||
// CHECK:STDOUT: class @Derived {
|
||||
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [concrete = constants.%Abstract]
|
||||
// CHECK:STDOUT: %.loc7: %Derived.elem.032 = base_decl %Abstract.ref, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc9_11.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %.loc9_11.2: type = converted %.loc9_11.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc9_8: %Derived.elem.87e = field_decl d, element1 [concrete]
|
||||
// CHECK:STDOUT: %.loc9: %Derived.elem.87e = field_decl d, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.base.d.be5 [concrete = constants.%complete_type.840]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
@@ -616,7 +613,7 @@ fn CallReturnAbstract() {
|
||||
// CHECK:STDOUT: .Self = constants.%Derived
|
||||
// CHECK:STDOUT: .Abstract = <poisoned>
|
||||
// CHECK:STDOUT: .base = %.loc7
|
||||
// CHECK:STDOUT: .d = %.loc9_8
|
||||
// CHECK:STDOUT: .d = %.loc9
|
||||
// CHECK:STDOUT: extend %Abstract.ref
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -646,11 +643,10 @@ fn CallReturnAbstract() {
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %Derived: type = class_type @Derived [concrete]
|
||||
// CHECK:STDOUT: %Derived.elem.032: type = unbound_element_type %Derived, %Abstract [concrete]
|
||||
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Derived.elem.87e: type = unbound_element_type %Derived, %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %struct_type.base.d: type = struct_type {.base: %Abstract, .d: %empty_struct_type} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.840: <witness> = complete_type_witness %struct_type.base.d [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %Abstract [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.a2e: type = pattern_type %Abstract [concrete]
|
||||
// CHECK:STDOUT: %.7d7: Core.Form = init_form %Abstract [concrete]
|
||||
// CHECK:STDOUT: %Return.type: type = fn_type @Return [concrete]
|
||||
// CHECK:STDOUT: %Return: %Return.type = struct_value () [concrete]
|
||||
@@ -674,10 +670,10 @@ fn CallReturnAbstract() {
|
||||
// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [concrete = constants.%Abstract] {} {}
|
||||
// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [concrete = constants.%Derived] {} {}
|
||||
// CHECK:STDOUT: %Return.decl: %Return.type = fn_decl @Return [concrete = constants.%Return] {
|
||||
// CHECK:STDOUT: %a.param_patt: %pattern_type = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type = at_binding_pattern a, %a.param_patt [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern %return.param_patt, %Abstract.ref.loc19_27 [concrete]
|
||||
// CHECK:STDOUT: %a.param_patt: %pattern_type.a2e = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.a2e = at_binding_pattern a, %a.param_patt [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.a2e = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.a2e = return_slot_pattern %return.param_patt, %Abstract.ref.loc19_27 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Abstract.ref.loc19_27: type = name_ref Abstract, file.%Abstract.decl [concrete = constants.%Abstract]
|
||||
// CHECK:STDOUT: %.loc19: Core.Form = init_form %Abstract.ref.loc19_27 [concrete = constants.%.7d7]
|
||||
@@ -700,9 +696,7 @@ fn CallReturnAbstract() {
|
||||
// CHECK:STDOUT: class @Derived {
|
||||
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [concrete = constants.%Abstract]
|
||||
// CHECK:STDOUT: %.loc7: %Derived.elem.032 = base_decl %Abstract.ref, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc9_11.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc9_11.2: type = converted %.loc9_11.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc9_8: %Derived.elem.87e = field_decl d, element1 [concrete]
|
||||
// CHECK:STDOUT: %.loc9: %Derived.elem.87e = field_decl d, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.base.d [concrete = constants.%complete_type.840]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
@@ -710,7 +704,7 @@ fn CallReturnAbstract() {
|
||||
// CHECK:STDOUT: .Self = constants.%Derived
|
||||
// CHECK:STDOUT: .Abstract = <poisoned>
|
||||
// CHECK:STDOUT: .base = %.loc7
|
||||
// CHECK:STDOUT: .d = %.loc9_8
|
||||
// CHECK:STDOUT: .d = %.loc9
|
||||
// CHECK:STDOUT: extend %Abstract.ref
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -726,6 +720,7 @@ fn CallReturnAbstract() {
|
||||
// CHECK:STDOUT: %Abstract: type = class_type @Abstract [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %Abstract.elem: type = unbound_element_type %Abstract, %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %struct_type.a.225: type = struct_type {.a: %empty_struct_type} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.8c6: <witness> = complete_type_witness %struct_type.a.225 [concrete]
|
||||
@@ -736,7 +731,6 @@ fn CallReturnAbstract() {
|
||||
// CHECK:STDOUT: %complete_type.840: <witness> = complete_type_witness %struct_type.base.d.be5 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.9f6: type = pattern_type %Derived [concrete]
|
||||
// CHECK:STDOUT: %.469: Core.Form = init_form %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %Access.type: type = fn_type @Access [concrete]
|
||||
// CHECK:STDOUT: %Access: %Access.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -776,23 +770,19 @@ fn CallReturnAbstract() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Abstract {
|
||||
// CHECK:STDOUT: %.loc4_11.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc4_11.2: type = converted %.loc4_11.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc4_8: %Abstract.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc4: %Abstract.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a.225 [concrete = constants.%complete_type.8c6]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%Abstract
|
||||
// CHECK:STDOUT: .a = %.loc4_8
|
||||
// CHECK:STDOUT: .a = %.loc4
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Derived {
|
||||
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [concrete = constants.%Abstract]
|
||||
// CHECK:STDOUT: %.loc8: %Derived.elem.032 = base_decl %Abstract.ref, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc10_11.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc10_11.2: type = converted %.loc10_11.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc10_8: %Derived.elem.87e = field_decl d, element1 [concrete]
|
||||
// CHECK:STDOUT: %.loc10: %Derived.elem.87e = field_decl d, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.base.d.be5 [concrete = constants.%complete_type.840]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
@@ -800,7 +790,7 @@ fn CallReturnAbstract() {
|
||||
// CHECK:STDOUT: .Self = constants.%Derived
|
||||
// CHECK:STDOUT: .Abstract = <poisoned>
|
||||
// CHECK:STDOUT: .base = %.loc8
|
||||
// CHECK:STDOUT: .d = %.loc10_8
|
||||
// CHECK:STDOUT: .d = %.loc10
|
||||
// CHECK:STDOUT: extend %Abstract.ref
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -18,7 +18,7 @@ library "[[@TEST_NAME]]";
|
||||
abstract class Abstract1 {}
|
||||
|
||||
class Contains {
|
||||
// CHECK:STDERR: fail_abstract_field.carbon:[[@LINE+7]]:10: error: field has abstract type `{.m1: Abstract1}` [AbstractTypeInFieldDecl]
|
||||
// CHECK:STDERR: fail_abstract_field.carbon:[[@LINE+7]]:10: error: binding pattern has abstract type `{.m1: Abstract1}` in `var` pattern [AbstractTypeInVarPattern]
|
||||
// CHECK:STDERR: var a: {.m1: Abstract1};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_abstract_field.carbon:[[@LINE-6]]:1: note: uses class that was declared abstract here [ClassAbstractHere]
|
||||
@@ -129,7 +129,6 @@ var v5: {.m: Abstract};
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %Contains: type = class_type @Contains [concrete]
|
||||
// CHECK:STDOUT: %struct_type.m1.ea7: type = struct_type {.m1: %Abstract1} [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -150,8 +149,6 @@ var v5: {.m: Abstract};
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Contains {
|
||||
// CHECK:STDOUT: %Abstract1.ref: type = name_ref Abstract1, file.%Abstract1.decl [concrete = constants.%Abstract1]
|
||||
// CHECK:STDOUT: %struct_type.m1: type = struct_type {.m1: %Abstract1} [concrete = constants.%struct_type.m1.ea7]
|
||||
// CHECK:STDOUT: %.loc13: <error> = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -18,7 +18,7 @@ library "[[@TEST_NAME]]";
|
||||
abstract class Abstract1 {}
|
||||
|
||||
class Contains {
|
||||
// CHECK:STDERR: fail_abstract_field.carbon:[[@LINE+7]]:10: error: field has abstract type `(Abstract1,)` [AbstractTypeInFieldDecl]
|
||||
// CHECK:STDERR: fail_abstract_field.carbon:[[@LINE+7]]:10: error: binding pattern has abstract type `(Abstract1,)` in `var` pattern [AbstractTypeInVarPattern]
|
||||
// CHECK:STDERR: var a: (Abstract1,);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_abstract_field.carbon:[[@LINE-6]]:1: note: uses class that was declared abstract here [ClassAbstractHere]
|
||||
@@ -139,9 +139,6 @@ fn Var5() {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %Contains: type = class_type @Contains [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.85c = tuple_value (%Abstract1) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.453: type = tuple_type (%Abstract1) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -171,17 +168,14 @@ fn Var5() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Contains {
|
||||
// CHECK:STDOUT: %Abstract1.ref: type = name_ref Abstract1, file.%Abstract1.decl [concrete = constants.%Abstract1]
|
||||
// CHECK:STDOUT: %.loc13_21.1: %tuple.type.85c = tuple_literal (%Abstract1.ref) [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc13_21.2: type = converted %.loc13_21.1, constants.%tuple.type.453 [concrete = constants.%tuple.type.453]
|
||||
// CHECK:STDOUT: %.loc13_8: <error> = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc13: <error> = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%Contains
|
||||
// CHECK:STDOUT: .Abstract1 = <poisoned>
|
||||
// CHECK:STDOUT: .a = %.loc13_8
|
||||
// CHECK:STDOUT: .a = %.loc13
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_abstract_var.carbon
|
||||
|
||||
@@ -160,8 +160,8 @@ class A {
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
|
||||
// CHECK:STDOUT: %Circle.elem: type = unbound_element_type %Circle, %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Circle.elem: type = unbound_element_type %Circle, %i32 [concrete]
|
||||
// CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
@@ -229,13 +229,12 @@ class A {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Circle {
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5: %Circle.elem = field_decl radius, element0 [concrete]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %SOME_INTERNAL_CONSTANT.patt: %pattern_type.7ce = value_binding_pattern SOME_INTERNAL_CONSTANT [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b]
|
||||
// CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %impl.elem0: %.9db = impl_witness_access constants.%ImplicitAs.impl_witness.ac5, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f1a]
|
||||
// CHECK:STDOUT: %bound_method.loc6_45.1: <bound method> = bound_method %int_5, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b65]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
@@ -360,12 +359,12 @@ class A {
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.1ec: <witness> = complete_type_witness %struct_type.x [concrete]
|
||||
// CHECK:STDOUT: %Run.type: type = fn_type @Run [concrete]
|
||||
// CHECK:STDOUT: %Run: %Run.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -389,7 +388,6 @@ class A {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @A {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.x [concrete = constants.%complete_type.1ec]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -420,10 +418,10 @@ class A {
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Circle.elem: type = unbound_element_type %Circle, %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.fcb: type = pattern_type %Circle [concrete]
|
||||
// CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Circle.GetRadius.type: type = fn_type @Circle.GetRadius [concrete]
|
||||
// CHECK:STDOUT: %Circle.GetRadius: %Circle.GetRadius.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Circle.SomeInternalFunction.type: type = fn_type @Circle.SomeInternalFunction [concrete]
|
||||
@@ -488,7 +486,6 @@ class A {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Circle {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5: %Circle.elem = field_decl radius, element0 [concrete]
|
||||
// CHECK:STDOUT: %Circle.GetRadius.decl: %Circle.GetRadius.type = fn_decl @Circle.GetRadius [concrete = constants.%Circle.GetRadius] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.fcb = value_param_pattern [concrete]
|
||||
|
||||
@@ -344,9 +344,7 @@ class B {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Shape {
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5: %Shape.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc6: %Shape.elem = field_decl y, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.x.y [concrete = constants.%complete_type.70a]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -740,6 +738,7 @@ class B {
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Shape.elem: type = unbound_element_type %Shape, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.y: type = struct_type {.y: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.0f9: <witness> = complete_type_witness %struct_type.y [concrete]
|
||||
@@ -747,7 +746,6 @@ class B {
|
||||
// CHECK:STDOUT: %Square.elem: type = unbound_element_type %Square, %Shape [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.1d2: type = pattern_type %Square [concrete]
|
||||
// CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Square.GetPosition.type: type = fn_type @Square.GetPosition [concrete]
|
||||
// CHECK:STDOUT: %Square.GetPosition: %Square.GetPosition.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %struct_type.base.490: type = struct_type {.base: %Shape} [concrete]
|
||||
@@ -775,7 +773,6 @@ class B {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Shape {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5: %Shape.elem = field_decl y, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.y [concrete = constants.%complete_type.0f9]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -1380,7 +1377,6 @@ class B {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @B {
|
||||
// CHECK:STDOUT: %Internal.ref: type = name_ref Internal, file.%Internal.decl [concrete = constants.%Internal]
|
||||
// CHECK:STDOUT: %.loc14: %B.elem = field_decl internal, element0 [concrete]
|
||||
// CHECK:STDOUT: %B.G.decl: %B.G.type = fn_decl @B.G [concrete = constants.%B.G] {
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern [concrete]
|
||||
@@ -1477,7 +1473,6 @@ class B {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @A {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.x [concrete = constants.%complete_type.1ec]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -1559,7 +1554,6 @@ class B {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @A {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5: %A.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.x [concrete = constants.%complete_type.1ec]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -61,9 +61,7 @@ class Access {
|
||||
// CHECK:STDOUT: class @Access {
|
||||
// CHECK:STDOUT: %Access.F.decl: %Access.F.type = fn_decl @Access.F [concrete = constants.%Access.F] {} {}
|
||||
// CHECK:STDOUT: %Access.G.decl: %Access.G.type = fn_decl @Access.G [concrete = constants.%Access.G] {} {}
|
||||
// CHECK:STDOUT: %i32.loc21: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc21: %Access.elem = field_decl k, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc23: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc23: %Access.elem = field_decl l, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.k.l [concrete = constants.%complete_type.48a]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -108,9 +108,7 @@ interface I {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @SomeClass {
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5: %SomeClass.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc6: %SomeClass.elem = field_decl b, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a.b [concrete = constants.%complete_type.705]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -220,9 +220,7 @@ fn F(a: IntAdapter) -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @SomeClass {
|
||||
// CHECK:STDOUT: %i32.loc7: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc7: %SomeClass.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc8: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc8: %SomeClass.elem = field_decl b, element1 [concrete]
|
||||
// CHECK:STDOUT: %SomeClass.StaticMemberFunction.decl: %SomeClass.StaticMemberFunction.type = fn_decl @SomeClass.StaticMemberFunction [concrete = constants.%SomeClass.StaticMemberFunction] {} {}
|
||||
// CHECK:STDOUT: %SomeClass.AdapterMethod.decl: %SomeClass.AdapterMethod.type = fn_decl @SomeClass.AdapterMethod [concrete = constants.%SomeClass.AdapterMethod] {
|
||||
@@ -363,13 +361,13 @@ fn F(a: IntAdapter) -> i32 {
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %SomeClass.elem: type = unbound_element_type %SomeClass, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.705: <witness> = complete_type_witness %struct_type.a.b [concrete]
|
||||
// CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.31a: type = pattern_type %SomeClassAdapter [concrete]
|
||||
// CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
@@ -414,9 +412,7 @@ fn F(a: IntAdapter) -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @SomeClass {
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5: %SomeClass.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc6: %SomeClass.elem = field_decl b, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a.b [concrete = constants.%complete_type.705]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -169,9 +169,8 @@ class AdaptWithBaseAndFields {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @AdaptWithField {
|
||||
// CHECK:STDOUT: %i32.loc8: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: adapt_decl %i32.loc8 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc13: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: adapt_decl %i32 [concrete]
|
||||
// CHECK:STDOUT: %.loc13: %AdaptWithField.elem = field_decl n, element<none> [concrete]
|
||||
// CHECK:STDOUT: complete_type_witness = <error>
|
||||
// CHECK:STDOUT:
|
||||
@@ -181,13 +180,10 @@ class AdaptWithBaseAndFields {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @AdaptWithFields {
|
||||
// CHECK:STDOUT: %i32.loc20: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: adapt_decl %i32.loc20 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc25: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: adapt_decl %i32 [concrete]
|
||||
// CHECK:STDOUT: %.loc25: %AdaptWithFields.elem = field_decl a, element<none> [concrete]
|
||||
// CHECK:STDOUT: %i32.loc26: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc26: %AdaptWithFields.elem = field_decl b, element<none> [concrete]
|
||||
// CHECK:STDOUT: %i32.loc27: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc27: %AdaptWithFields.elem = field_decl c, element<none> [concrete]
|
||||
// CHECK:STDOUT: complete_type_witness = <error>
|
||||
// CHECK:STDOUT:
|
||||
@@ -245,7 +241,6 @@ class AdaptWithBaseAndFields {
|
||||
// CHECK:STDOUT: class @AdaptWithBaseAndFields {
|
||||
// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [concrete = constants.%Base]
|
||||
// CHECK:STDOUT: %.loc7: %AdaptWithBaseAndFields.elem.43f = base_decl %Base.ref, element<none> [concrete]
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc8: %AdaptWithBaseAndFields.elem.37a = field_decl n, element<none> [concrete]
|
||||
// CHECK:STDOUT: %.loc16_10: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc16_11: type = converted %.loc16_10, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
|
||||
@@ -243,9 +243,7 @@ var e: C = MakeAdaptC();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5: %C.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc6: %C.elem = field_decl b, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a.b.501 [concrete = constants.%complete_type.705]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -450,9 +448,7 @@ var e: C = MakeAdaptC();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5: %C.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc6: %C.elem = field_decl b, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a.b.501 [concrete = constants.%complete_type.705]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
-1
@@ -158,7 +158,6 @@ fn Run() -> i32 {
|
||||
// CHECK:STDOUT: %return.param.loc20: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return.loc20: ref %i32 = return_slot %return.param.loc20
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc22: %Class.elem = field_decl k, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.k [concrete = constants.%complete_type.954]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -84,7 +84,6 @@ class C {
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc18: %C.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a [concrete = constants.%complete_type.fd7]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
+1
-1
@@ -147,7 +147,7 @@ fn CallReturnIncomplete() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_in_definition.carbon:[[@LINE+7]]:10: error: field has incomplete type `C` [IncompleteTypeInFieldDecl]
|
||||
// CHECK:STDERR: fail_in_definition.carbon:[[@LINE+7]]:10: error: binding pattern has incomplete type `C` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: var c: C;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_in_definition.carbon:[[@LINE-4]]:1: note: class is incomplete within its definition [ClassIncompleteWithinDefinition]
|
||||
|
||||
@@ -35,19 +35,19 @@ class Class {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class Class {
|
||||
// CHECK:STDERR: fail_var.carbon:[[@LINE+8]]:8: error: expected `:` in field declaration [ExpectedFieldColon]
|
||||
// CHECK:STDERR: fail_var.carbon:[[@LINE+8]]:7: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: var C:! type = Class;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_var.carbon:[[@LINE+4]]:3: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_var.carbon:[[@LINE+4]]:16: error: found `:!` pattern inside `var` pattern [NonRegularBindingInVarDecl]
|
||||
// CHECK:STDERR: var C:! type = Class;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var C:! type = Class;
|
||||
|
||||
// CHECK:STDERR: fail_var.carbon:[[@LINE+4]]:7: error: expected identifier in field declaration [ExpectedFieldIdentifier]
|
||||
// CHECK:STDERR: fail_var.carbon:[[@LINE+4]]:25: error: found `:!` pattern inside `var` pattern [NonRegularBindingInVarDecl]
|
||||
// CHECK:STDERR: var template D:! type = Class;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var template D:! type = Class;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* {
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.a.b.c: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.ebc: <witness> = complete_type_witness %struct_type.a.b.c [concrete]
|
||||
@@ -60,7 +61,6 @@ fn AccessBaseIndirect(p: Derived*) -> i32* {
|
||||
// CHECK:STDOUT: %complete_type.ea9: <witness> = complete_type_witness %struct_type.base.d.e.b4b [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.9f6: type = pattern_type %Derived [concrete]
|
||||
// CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %AccessDerived.type: type = fn_type @AccessDerived [concrete]
|
||||
// CHECK:STDOUT: %AccessDerived: %AccessDerived.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
|
||||
@@ -191,11 +191,8 @@ fn AccessBaseIndirect(p: Derived*) -> i32* {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Base {
|
||||
// CHECK:STDOUT: %i32.loc16: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc16: %Base.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc17: %Base.elem = field_decl b, element1 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc18: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc18: %Base.elem = field_decl c, element2 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a.b.c [concrete = constants.%complete_type.ebc]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -210,9 +207,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* {
|
||||
// CHECK:STDOUT: class @Derived {
|
||||
// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [concrete = constants.%Base]
|
||||
// CHECK:STDOUT: %.loc22: %Derived.elem.029 = base_decl %Base.ref, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc24: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc24: %Derived.elem.530 = field_decl d, element1 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc25: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc25: %Derived.elem.530 = field_decl e, element2 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.base.d.e.b4b [concrete = constants.%complete_type.ea9]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/field/fail_todo_field_initializer.carbon
|
||||
|
||||
class Class {
|
||||
// CHECK:STDERR: fail_todo_field_initializer.carbon:[[@LINE+4]]:3: error: semantics TODO: `Field initializer` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_field_initializer.carbon:[[@LINE+4]]:18: error: semantics TODO: `Field initializer` [SemanticsTodo]
|
||||
// CHECK:STDERR: var field: i32 = 0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var field: i32 = 0;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ fn Run() {
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.j.k: type = struct_type {.j: %i32, .k: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.cf7: <witness> = complete_type_witness %struct_type.j.k [concrete]
|
||||
@@ -65,7 +66,6 @@ fn Run() {
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b91: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
|
||||
// CHECK:STDOUT: %.9db: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b91, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.d43: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.f1a [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.f1a, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.e79: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
|
||||
@@ -125,9 +125,7 @@ fn Run() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Class {
|
||||
// CHECK:STDOUT: %i32.loc16: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc16: %Class.elem = field_decl j, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc17: %Class.elem = field_decl k, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.j.k [concrete = constants.%complete_type.cf7]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -37,6 +37,7 @@ fn Test() {
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.j.k: type = struct_type {.j: %i32, .k: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.cf7: <witness> = complete_type_witness %struct_type.j.k [concrete]
|
||||
@@ -66,7 +67,6 @@ fn Test() {
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b91: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
|
||||
// CHECK:STDOUT: %.9db: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b91, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.d43: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.f1a [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.f1a, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.e79: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
|
||||
@@ -126,9 +126,7 @@ fn Test() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Class {
|
||||
// CHECK:STDOUT: %i32.loc16: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc16: %Class.elem = field_decl j, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc17: %Class.elem = field_decl k, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.j.k [concrete = constants.%complete_type.cf7]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -226,7 +226,6 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 {
|
||||
// CHECK:STDOUT: %complete_type.loc6_1.2: <witness> = complete_type_witness %struct_type.x [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_10.2 [symbolic = %T.loc4_10.1 (constants.%T.67d)]
|
||||
// CHECK:STDOUT: %.loc5: @C.%C.elem (%C.elem.bd3) = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc6_1.1: <witness> = complete_type_witness constants.%struct_type.x.0c5 [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc6_1.1
|
||||
@@ -524,7 +523,6 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 {
|
||||
// CHECK:STDOUT: %complete_type.loc6_1.2: <witness> = complete_type_witness %struct_type.x [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_10.2 [symbolic = %T.loc4_10.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc5: @C.%C.elem (%C.elem.bd3) = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc6_1.1: <witness> = complete_type_witness constants.%struct_type.x.0c5 [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc6_1.1
|
||||
@@ -641,7 +639,6 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 {
|
||||
// CHECK:STDOUT: %complete_type.loc9_1.2: <witness> = complete_type_witness %struct_type.x [symbolic = %complete_type.loc9_1.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_10.2 [symbolic = %T.loc7_10.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc8: @C.%C.elem (%C.elem.bd3) = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc9_1.1: <witness> = complete_type_witness constants.%struct_type.x.0c5 [symbolic = %complete_type.loc9_1.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc9_1.1
|
||||
@@ -1068,7 +1065,6 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11: %C.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type.54b]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -109,6 +109,7 @@ fn H() {
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Param.elem: type = unbound_element_type %Param, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.y: type = struct_type {.y: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.0f9: <witness> = complete_type_witness %struct_type.y [concrete]
|
||||
@@ -122,7 +123,6 @@ fn H() {
|
||||
// CHECK:STDOUT: %complete_type.8de: <witness> = complete_type_witness %struct_type.base.9a9 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.9f6: type = pattern_type %Derived [concrete]
|
||||
// CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %DoubleFieldAccess.type: type = fn_type @DoubleFieldAccess [concrete]
|
||||
// CHECK:STDOUT: %DoubleFieldAccess: %DoubleFieldAccess.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
|
||||
@@ -197,7 +197,6 @@ fn H() {
|
||||
// CHECK:STDOUT: %complete_type.loc6_1.2: <witness> = complete_type_witness %struct_type.x [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_18.2 [symbolic = %T.loc4_18.1 (constants.%T.67d)]
|
||||
// CHECK:STDOUT: %.loc5: @Base.%Base.elem (%Base.elem.8ab) = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc6_1.1: <witness> = complete_type_witness constants.%struct_type.x.0c5 [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc6_1.1
|
||||
@@ -210,7 +209,6 @@ fn H() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Param {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc9: %Param.elem = field_decl y, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.y [concrete = constants.%complete_type.0f9]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
+9
-12
@@ -115,11 +115,11 @@ class Declaration(T:! type);
|
||||
// CHECK:STDOUT: %Class.GetAddr: @Class.%Class.GetAddr.type (%Class.GetAddr.type) = struct_value () [symbolic = %Class.GetAddr (constants.%Class.GetAddr)]
|
||||
// CHECK:STDOUT: %Class.GetValue.type: type = fn_type @Class.GetValue, @Class(%T.loc5_14.1) [symbolic = %Class.GetValue.type (constants.%Class.GetValue.type)]
|
||||
// CHECK:STDOUT: %Class.GetValue: @Class.%Class.GetValue.type (%Class.GetValue.type) = struct_value () [symbolic = %Class.GetValue (constants.%Class.GetValue)]
|
||||
// CHECK:STDOUT: %T.as_type.loc14_10.2: type = facet_access_type %T.loc5_14.1 [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc14_10.2 [symbolic = %require_complete (constants.%require_complete.89e)]
|
||||
// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.loc5_14.1 [symbolic = %T.as_type (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type [symbolic = %require_complete (constants.%require_complete.89e)]
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc5_14.1) [symbolic = %Class (constants.%Class)]
|
||||
// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc14_10.2 [symbolic = %Class.elem (constants.%Class.elem)]
|
||||
// CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @Class.%T.as_type.loc14_10.2 (%T.as_type)} [symbolic = %struct_type.k (constants.%struct_type.k)]
|
||||
// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type [symbolic = %Class.elem (constants.%Class.elem)]
|
||||
// CHECK:STDOUT: %struct_type.k: type = struct_type {.k: @Class.%T.as_type (%T.as_type)} [symbolic = %struct_type.k (constants.%struct_type.k)]
|
||||
// CHECK:STDOUT: %complete_type.loc15_1.2: <witness> = complete_type_witness %struct_type.k [symbolic = %complete_type.loc15_1.2 (constants.%complete_type)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
@@ -162,10 +162,7 @@ class Declaration(T:! type);
|
||||
// CHECK:STDOUT: %return.param: ref @Class.GetValue.%T.as_type.loc10_32.1 (%T.as_type) = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref @Class.GetValue.%T.as_type.loc10_32.1 (%T.as_type) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, %T.loc5_14.2 [symbolic = %T.loc5_14.1 (constants.%T.035)]
|
||||
// CHECK:STDOUT: %T.as_type.loc14_10.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc14_10: type = converted %T.ref, %T.as_type.loc14_10.1 [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc14_8: @Class.%Class.elem (%Class.elem) = field_decl k, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc14: @Class.%Class.elem (%Class.elem) = field_decl k, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc15_1.1: <witness> = complete_type_witness constants.%struct_type.k [symbolic = %complete_type.loc15_1.2 (constants.%complete_type)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc15_1.1
|
||||
// CHECK:STDOUT:
|
||||
@@ -174,7 +171,7 @@ class Declaration(T:! type);
|
||||
// CHECK:STDOUT: .T = <poisoned>
|
||||
// CHECK:STDOUT: .GetAddr = %Class.GetAddr.decl
|
||||
// CHECK:STDOUT: .GetValue = %Class.GetValue.decl
|
||||
// CHECK:STDOUT: .k = %.loc14_8
|
||||
// CHECK:STDOUT: .k = %.loc14
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -208,7 +205,7 @@ class Declaration(T:! type);
|
||||
// CHECK:STDOUT: fn(%self.param: ref @Class.GetAddr.%Class (%Class)) -> out %return.param: @Class.GetAddr.%ptr.loc6_36.1 (%ptr.de9) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %self.ref: ref @Class.GetAddr.%Class (%Class) = name_ref self, %self
|
||||
// CHECK:STDOUT: %k.ref: @Class.GetAddr.%Class.elem (%Class.elem) = name_ref k, @Class.%.loc14_8 [concrete = @Class.%.loc14_8]
|
||||
// CHECK:STDOUT: %k.ref: @Class.GetAddr.%Class.elem (%Class.elem) = name_ref k, @Class.%.loc14 [concrete = @Class.%.loc14]
|
||||
// CHECK:STDOUT: %.loc7_17: ref @Class.GetAddr.%T.as_type.loc6_36.1 (%T.as_type) = class_element_access %self.ref, element0
|
||||
// CHECK:STDOUT: %addr: @Class.GetAddr.%ptr.loc6_36.1 (%ptr.de9) = addr_of %.loc7_17
|
||||
// CHECK:STDOUT: %impl.elem0.loc7_12.1: @Class.GetAddr.%.loc7_12.2 (%.113) = impl_witness_access constants.%Copy.lookup_impl_witness.b83, element0 [symbolic = %impl.elem0.loc7_12.2 (constants.%impl.elem0.10e)]
|
||||
@@ -241,7 +238,7 @@ class Declaration(T:! type);
|
||||
// CHECK:STDOUT: fn(%self.param: @Class.GetValue.%Class (%Class)) -> out %return.param: @Class.GetValue.%T.as_type.loc10_32.1 (%T.as_type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %self.ref: @Class.GetValue.%Class (%Class) = name_ref self, %self
|
||||
// CHECK:STDOUT: %k.ref: @Class.GetValue.%Class.elem (%Class.elem) = name_ref k, @Class.%.loc14_8 [concrete = @Class.%.loc14_8]
|
||||
// CHECK:STDOUT: %k.ref: @Class.GetValue.%Class.elem (%Class.elem) = name_ref k, @Class.%.loc14 [concrete = @Class.%.loc14]
|
||||
// CHECK:STDOUT: %.loc11_16.1: ref @Class.GetValue.%T.as_type.loc10_32.1 (%T.as_type) = class_element_access %self.ref, element0
|
||||
// CHECK:STDOUT: %.loc11_16.2: @Class.GetValue.%T.as_type.loc10_32.1 (%T.as_type) = acquire_value %.loc11_16.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_16.1: @Class.GetValue.%.loc11_16.3 (%.023) = impl_witness_access constants.%Copy.lookup_impl_witness.58d, element0 [symbolic = %impl.elem0.loc11_16.2 (constants.%impl.elem0.594)]
|
||||
@@ -262,7 +259,7 @@ class Declaration(T:! type);
|
||||
// CHECK:STDOUT: %Class.GetAddr => constants.%Class.GetAddr
|
||||
// CHECK:STDOUT: %Class.GetValue.type => constants.%Class.GetValue.type
|
||||
// CHECK:STDOUT: %Class.GetValue => constants.%Class.GetValue
|
||||
// CHECK:STDOUT: %T.as_type.loc14_10.2 => constants.%T.as_type
|
||||
// CHECK:STDOUT: %T.as_type => constants.%T.as_type
|
||||
// CHECK:STDOUT: %require_complete => constants.%require_complete.89e
|
||||
// CHECK:STDOUT: %Class => constants.%Class
|
||||
// CHECK:STDOUT: %Class.elem => constants.%Class.elem
|
||||
|
||||
@@ -62,19 +62,11 @@ fn F(a: A(0)*) {
|
||||
// CHECK:STDOUT: %A.elem.ade: type = unbound_element_type %A.54d, %B [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.139: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
|
||||
// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f67: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.8fd: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f67 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %From: Core.IntLiteral = symbolic_binding From, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.7d6: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%From) [symbolic]
|
||||
// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.81b: %Int.as.ImplicitAs.impl.Convert.type.7d6 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.176: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.577, @Int.as.ImplicitAs.impl(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.c8f: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.741: %Int.as.ImplicitAs.impl.Convert.type.c8f = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet.e7a: %ImplicitAs.type.139 = facet_value %i32, (%ImplicitAs.impl_witness.176) [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.00f: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(Core.IntLiteral, %ImplicitAs.facet.e7a) [concrete]
|
||||
// CHECK:STDOUT: %.42f: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.00f, %ImplicitAs.facet.e7a [concrete]
|
||||
// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound.834: <bound method> = bound_method %N.5de, %Int.as.ImplicitAs.impl.Convert.741 [symbolic]
|
||||
// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Int.as.ImplicitAs.impl.Convert.741, @Int.as.ImplicitAs.impl.Convert(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.d2e: <bound method> = bound_method %N.5de, %Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic]
|
||||
@@ -121,8 +113,6 @@ fn F(a: A(0)*) {
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.70a: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f67) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.8fd)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.82d = impl_witness_table (%Core.import_ref.70a), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
|
||||
// CHECK:STDOUT: %Core.import_ref.e0f: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.7d6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.81b)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.577 = impl_witness_table (%Core.import_ref.e0f), @Int.as.ImplicitAs.impl [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -203,9 +193,9 @@ fn F(a: A(0)*) {
|
||||
// CHECK:STDOUT: %A: type = class_type @A, @A(%N.loc6_10.1) [symbolic = %A (constants.%A.54d)]
|
||||
// CHECK:STDOUT: %A.elem.loc7: type = unbound_element_type %A, constants.%B [symbolic = %A.elem.loc7 (constants.%A.elem.ade)]
|
||||
// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.loc6_10.1, constants.%Int.as.ImplicitAs.impl.Convert.741 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound.834)]
|
||||
// CHECK:STDOUT: %bound_method.loc9_14.3: <bound method> = bound_method %N.loc6_10.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc9_14.3 (constants.%bound_method.d2e)]
|
||||
// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2: init Core.IntLiteral = call %bound_method.loc9_14.3(%N.loc6_10.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
|
||||
// CHECK:STDOUT: %iN.builtin: type = int_type signed, %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2 [symbolic = %iN.builtin (constants.%iN.builtin.609)]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %N.loc6_10.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method (constants.%bound_method.d2e)]
|
||||
// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method(%N.loc6_10.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call (constants.%Int.as.ImplicitAs.impl.Convert.call)]
|
||||
// CHECK:STDOUT: %iN.builtin: type = int_type signed, %Int.as.ImplicitAs.impl.Convert.call [symbolic = %iN.builtin (constants.%iN.builtin.609)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %iN.builtin [symbolic = %require_complete (constants.%require_complete.77f)]
|
||||
// CHECK:STDOUT: %A.elem.loc9: type = unbound_element_type %A, %iN.builtin [symbolic = %A.elem.loc9 (constants.%A.elem.5a9)]
|
||||
// CHECK:STDOUT: %struct_type.base.n: type = struct_type {.base: %B, .n: @A.%iN.builtin (%iN.builtin.609)} [symbolic = %struct_type.base.n (constants.%struct_type.base.n)]
|
||||
@@ -214,19 +204,7 @@ fn F(a: A(0)*) {
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
|
||||
// CHECK:STDOUT: %.loc7: @A.%A.elem.loc7 (%A.elem.ade) = base_decl %B.ref, element0 [concrete]
|
||||
// CHECK:STDOUT: %Int.ref: %Int.type.b3e = name_ref Int, file.%Int.decl [concrete = constants.%Int.d6d]
|
||||
// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc6_10.2 [symbolic = %N.loc6_10.1 (constants.%N.5de)]
|
||||
// CHECK:STDOUT: %impl.elem0: %.42f = impl_witness_access constants.%ImplicitAs.impl_witness.176, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.741]
|
||||
// CHECK:STDOUT: %bound_method.loc9_14.1: <bound method> = bound_method %N.ref, %impl.elem0 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound.834)]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc9_14.2: <bound method> = bound_method %N.ref, %specific_fn [symbolic = %bound_method.loc9_14.3 (constants.%bound_method.d2e)]
|
||||
// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc9_14.1: init Core.IntLiteral = call %bound_method.loc9_14.2(%N.ref) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
|
||||
// CHECK:STDOUT: %.loc9_14.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call.loc9_14.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
|
||||
// CHECK:STDOUT: %.loc9_14.2: Core.IntLiteral = converted %N.ref, %.loc9_14.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
|
||||
// CHECK:STDOUT: %Int.call: init type = call %Int.ref(%.loc9_14.2) [symbolic = %iN.builtin (constants.%iN.builtin.609)]
|
||||
// CHECK:STDOUT: %.loc9_15.1: type = value_of_initializer %Int.call [symbolic = %iN.builtin (constants.%iN.builtin.609)]
|
||||
// CHECK:STDOUT: %.loc9_15.2: type = converted %Int.call, %.loc9_15.1 [symbolic = %iN.builtin (constants.%iN.builtin.609)]
|
||||
// CHECK:STDOUT: %.loc9_8: @A.%A.elem.loc9 (%A.elem.5a9) = field_decl n, element1 [concrete]
|
||||
// CHECK:STDOUT: %.loc9: @A.%A.elem.loc9 (%A.elem.5a9) = field_decl n, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc10_1.1: <witness> = complete_type_witness constants.%struct_type.base.n [symbolic = %complete_type.loc10_1.2 (constants.%complete_type.943)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc10_1.1
|
||||
// CHECK:STDOUT:
|
||||
@@ -236,7 +214,7 @@ fn F(a: A(0)*) {
|
||||
// CHECK:STDOUT: .base = %.loc7
|
||||
// CHECK:STDOUT: .Int = <poisoned>
|
||||
// CHECK:STDOUT: .N = <poisoned>
|
||||
// CHECK:STDOUT: .n = %.loc9_8
|
||||
// CHECK:STDOUT: .n = %.loc9
|
||||
// CHECK:STDOUT: extend %B.ref
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -272,8 +250,8 @@ fn F(a: A(0)*) {
|
||||
// CHECK:STDOUT: %A => constants.%A.dc6
|
||||
// CHECK:STDOUT: %A.elem.loc7 => constants.%A.elem.665
|
||||
// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound => constants.%Int.as.ImplicitAs.impl.Convert.bound.b0c
|
||||
// CHECK:STDOUT: %bound_method.loc9_14.3 => constants.%bound_method.62a
|
||||
// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc9_14.2 => constants.%int_0.5c6
|
||||
// CHECK:STDOUT: %bound_method => constants.%bound_method.62a
|
||||
// CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call => constants.%int_0.5c6
|
||||
// CHECK:STDOUT: %iN.builtin => <error>
|
||||
// CHECK:STDOUT: %require_complete => <error>
|
||||
// CHECK:STDOUT: %A.elem.loc9 => <error>
|
||||
|
||||
@@ -223,7 +223,6 @@ fn H(U:! Core.Copy, c: Class(U)) -> U {
|
||||
// CHECK:STDOUT: %complete_type.loc7_1.2: <witness> = complete_type_witness %struct_type.x [symbolic = %complete_type.loc7_1.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc5_14.2 [symbolic = %T.loc5_14.1 (constants.%T.67d)]
|
||||
// CHECK:STDOUT: %.loc6: @Class.%Class.elem (%Class.elem.fdf) = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc7_1.1: <witness> = complete_type_witness constants.%struct_type.x.0c5 [symbolic = %complete_type.loc7_1.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc7_1.1
|
||||
|
||||
+1
-4
@@ -104,9 +104,9 @@ class Class(U:! type) {
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %CompleteClass.elem: type = unbound_element_type %CompleteClass.152, %i32 [symbolic]
|
||||
// CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %CompleteClass.F.type: type = fn_type @CompleteClass.F, @CompleteClass(%T) [symbolic]
|
||||
// CHECK:STDOUT: %CompleteClass.F: %CompleteClass.F.type = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [concrete]
|
||||
@@ -203,7 +203,6 @@ class Class(U:! type) {
|
||||
// CHECK:STDOUT: %CompleteClass.F: @CompleteClass.%CompleteClass.F.type (%CompleteClass.F.type) = struct_value () [symbolic = %CompleteClass.F (constants.%CompleteClass.F)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc7: @CompleteClass.%CompleteClass.elem (%CompleteClass.elem) = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %CompleteClass.F.decl: @CompleteClass.%CompleteClass.F.type (%CompleteClass.F.type) = fn_decl @CompleteClass.F [symbolic = @CompleteClass.%CompleteClass.F (constants.%CompleteClass.F)] {
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern [concrete]
|
||||
@@ -382,7 +381,6 @@ class Class(U:! type) {
|
||||
// CHECK:STDOUT: %complete_type.loc6_1.2: <witness> = complete_type_witness %struct_type.x [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4 [symbolic = %T.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc5: @Class.%Class.elem (%Class.elem) = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc6_1.1: <witness> = complete_type_witness constants.%struct_type.x [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc6_1.1
|
||||
@@ -928,7 +926,6 @@ class Class(U:! type) {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %T.ref: <error> = name_ref T, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc17: <error> = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
+2
-2
@@ -254,7 +254,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.46c) = ref_binding v, %v.var
|
||||
// CHECK:STDOUT: %v.ref: ref @InitFromStructGeneric.%Class.loc10_17.2 (%Class.46c) = name_ref v, %v
|
||||
// CHECK:STDOUT: %k.ref: @InitFromStructGeneric.%Class.elem (%Class.elem.ef9) = name_ref k, @Class.%.loc5_8 [concrete = @Class.%.loc5_8]
|
||||
// CHECK:STDOUT: %k.ref: @InitFromStructGeneric.%Class.elem (%Class.elem.ef9) = name_ref k, @Class.%.loc5 [concrete = @Class.%.loc5]
|
||||
// CHECK:STDOUT: %.loc11_11.1: ref @InitFromStructGeneric.%T.as_type.loc9_59.1 (%T.as_type.db4) = class_element_access %v.ref, element0
|
||||
// CHECK:STDOUT: %.loc11_11.2: @InitFromStructGeneric.%T.as_type.loc9_59.1 (%T.as_type.db4) = acquire_value %.loc11_11.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc11: @InitFromStructGeneric.%.loc10_27 (%.e56) = impl_witness_access constants.%Copy.lookup_impl_witness.322, element0 [symbolic = %impl.elem0.loc10_27.2 (constants.%impl.elem0.bab)]
|
||||
@@ -300,7 +300,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref %Class.02d = ref_binding v, %v.var
|
||||
// CHECK:STDOUT: %v.ref: ref %Class.02d = name_ref v, %v
|
||||
// CHECK:STDOUT: %k.ref: %Class.elem.2a7 = name_ref k, @Class.%.loc5_8 [concrete = @Class.%.loc5_8]
|
||||
// CHECK:STDOUT: %k.ref: %Class.elem.2a7 = name_ref k, @Class.%.loc5 [concrete = @Class.%.loc5]
|
||||
// CHECK:STDOUT: %.loc16_11.1: ref %i32 = class_element_access %v.ref, element0
|
||||
// CHECK:STDOUT: %.loc16_11.2: %i32 = acquire_value %.loc16_11.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc16: %.348 = impl_witness_access constants.%Copy.impl_witness.30d, element0 [concrete = constants.%Int.as.Copy.impl.Op.44b]
|
||||
|
||||
@@ -70,10 +70,10 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) {
|
||||
// CHECK:STDOUT: %Class.847: type = class_type @Class, @Class(%T.035) [symbolic]
|
||||
// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.035 [symbolic]
|
||||
// CHECK:STDOUT: %require_complete.89e: <witness> = require_complete_type %T.as_type [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.3b9bb5.2: type = pattern_type %T.as_type [symbolic]
|
||||
// CHECK:STDOUT: %Class.elem.555: type = unbound_element_type %Class.847, %T.as_type [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.893: type = pattern_type %Class.847 [symbolic]
|
||||
// CHECK:STDOUT: %.435d17.2: Core.Form = init_form %T.as_type [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.3b9bb5.2: type = pattern_type %T.as_type [symbolic]
|
||||
// CHECK:STDOUT: %Class.Get.type.8ea: type = fn_type @Class.Get, @Class(%T.035) [symbolic]
|
||||
// CHECK:STDOUT: %Class.Get.7d3: %Class.Get.type.8ea = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ptr.de9: type = ptr_type %T.as_type [symbolic]
|
||||
@@ -160,7 +160,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%Class.847
|
||||
// CHECK:STDOUT: .T = <poisoned>
|
||||
// CHECK:STDOUT: .x = %.loc5_8
|
||||
// CHECK:STDOUT: .x = %.loc5
|
||||
// CHECK:STDOUT: .Get = %Class.Get.decl
|
||||
// CHECK:STDOUT: .GetAddr = %Class.GetAddr.decl
|
||||
// CHECK:STDOUT: }
|
||||
@@ -182,7 +182,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) {
|
||||
// CHECK:STDOUT: fn(%self.param: @Class.Get.%Class (%Class.847)) -> out %return.param: @Class.Get.%T.as_type.loc7_27.1 (%T.as_type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %self.ref: @Class.Get.%Class (%Class.847) = name_ref self, %self
|
||||
// CHECK:STDOUT: %x.ref: @Class.Get.%Class.elem (%Class.elem.555) = name_ref x, @Class.%.loc5_8 [concrete = @Class.%.loc5_8]
|
||||
// CHECK:STDOUT: %x.ref: @Class.Get.%Class.elem (%Class.elem.555) = name_ref x, @Class.%.loc5 [concrete = @Class.%.loc5]
|
||||
// CHECK:STDOUT: %.loc9_16.1: ref @Class.Get.%T.as_type.loc7_27.1 (%T.as_type) = class_element_access %self.ref, element0
|
||||
// CHECK:STDOUT: %.loc9_16.2: @Class.Get.%T.as_type.loc7_27.1 (%T.as_type) = acquire_value %.loc9_16.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc9_16.1: @Class.Get.%.loc9_16.3 (%.023) = impl_witness_access constants.%Copy.lookup_impl_witness.58d, element0 [symbolic = %impl.elem0.loc9_16.2 (constants.%impl.elem0.594)]
|
||||
@@ -212,7 +212,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) {
|
||||
// CHECK:STDOUT: fn(%self.param: ref @Class.GetAddr.%Class (%Class.847)) -> out %return.param: @Class.GetAddr.%ptr.loc13_36.1 (%ptr.de9) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %self.ref: ref @Class.GetAddr.%Class (%Class.847) = name_ref self, %self
|
||||
// CHECK:STDOUT: %x.ref: @Class.GetAddr.%Class.elem (%Class.elem.555) = name_ref x, @Class.%.loc5_8 [concrete = @Class.%.loc5_8]
|
||||
// CHECK:STDOUT: %x.ref: @Class.GetAddr.%Class.elem (%Class.elem.555) = name_ref x, @Class.%.loc5 [concrete = @Class.%.loc5]
|
||||
// CHECK:STDOUT: %.loc15_17: ref @Class.GetAddr.%T.as_type.loc13_36.1 (%T.as_type) = class_element_access %self.ref, element0
|
||||
// CHECK:STDOUT: %addr: @Class.GetAddr.%ptr.loc13_36.1 (%ptr.de9) = addr_of %.loc15_17
|
||||
// CHECK:STDOUT: %impl.elem0.loc15_12.1: @Class.GetAddr.%.loc15_12.2 (%.113) = impl_witness_access constants.%Copy.lookup_impl_witness.b83, element0 [symbolic = %impl.elem0.loc15_12.2 (constants.%impl.elem0.10e)]
|
||||
@@ -227,7 +227,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) {
|
||||
// CHECK:STDOUT: fn @DirectFieldAccess(%x.param: %Class.727) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %x.ref.loc22_10: %Class.727 = name_ref x, %x
|
||||
// CHECK:STDOUT: %x.ref.loc22_11: %Class.elem.1ff = name_ref x, @Class.%.loc5_8 [concrete = @Class.%.loc5_8]
|
||||
// CHECK:STDOUT: %x.ref.loc22_11: %Class.elem.1ff = name_ref x, @Class.%.loc5 [concrete = @Class.%.loc5]
|
||||
// CHECK:STDOUT: %.loc22_11.1: ref %i32 = class_element_access %x.ref.loc22_10, element0
|
||||
// CHECK:STDOUT: %.loc22_11.2: %i32 = acquire_value %.loc22_11.1
|
||||
// CHECK:STDOUT: %impl.elem0: %.348 = impl_witness_access constants.%Copy.impl_witness.30d, element0 [concrete = constants.%Int.as.Copy.impl.Op.44b]
|
||||
@@ -276,7 +276,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) {
|
||||
// CHECK:STDOUT: %T.loc4_14.1 => constants.%T.035
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %T.as_type.loc5_10.2 => constants.%T.as_type
|
||||
// CHECK:STDOUT: %T.as_type => constants.%T.as_type
|
||||
// CHECK:STDOUT: %require_complete => constants.%require_complete.89e
|
||||
// CHECK:STDOUT: %Class => constants.%Class.847
|
||||
// CHECK:STDOUT: %Class.elem => constants.%Class.elem.555
|
||||
@@ -311,7 +311,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) {
|
||||
// CHECK:STDOUT: %T.loc4_14.1 => constants.%Copy.facet.d1a
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %T.as_type.loc5_10.2 => constants.%i32
|
||||
// CHECK:STDOUT: %T.as_type => constants.%i32
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.f8a
|
||||
// CHECK:STDOUT: %Class => constants.%Class.727
|
||||
// CHECK:STDOUT: %Class.elem => constants.%Class.elem.1ff
|
||||
|
||||
+11
-17
@@ -106,11 +106,11 @@ class C(T:! Core.Copy) {
|
||||
// CHECK:STDOUT: %Class.F: @Class.%Class.F.type (%Class.F.type) = struct_value () [symbolic = %Class.F (constants.%Class.F)]
|
||||
// CHECK:STDOUT: %Class.G.type: type = fn_type @Class.G, @Class(%T.loc5_14.1) [symbolic = %Class.G.type (constants.%Class.G.type)]
|
||||
// CHECK:STDOUT: %Class.G: @Class.%Class.G.type (%Class.G.type) = struct_value () [symbolic = %Class.G (constants.%Class.G)]
|
||||
// CHECK:STDOUT: %T.as_type.loc14_10.2: type = facet_access_type %T.loc5_14.1 [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc14_10.2 [symbolic = %require_complete (constants.%require_complete.89e)]
|
||||
// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.loc5_14.1 [symbolic = %T.as_type (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type [symbolic = %require_complete (constants.%require_complete.89e)]
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc5_14.1) [symbolic = %Class (constants.%Class)]
|
||||
// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc14_10.2 [symbolic = %Class.elem (constants.%Class.elem)]
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Class.%T.as_type.loc14_10.2 (%T.as_type)} [symbolic = %struct_type.n (constants.%struct_type.n)]
|
||||
// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type [symbolic = %Class.elem (constants.%Class.elem)]
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Class.%T.as_type (%T.as_type)} [symbolic = %struct_type.n (constants.%struct_type.n)]
|
||||
// CHECK:STDOUT: %complete_type.loc15_1.2: <witness> = complete_type_witness %struct_type.n [symbolic = %complete_type.loc15_1.2 (constants.%complete_type)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
@@ -153,10 +153,7 @@ class C(T:! Core.Copy) {
|
||||
// CHECK:STDOUT: %return.param: ref @Class.G.%T.as_type.loc10_25.1 (%T.as_type) = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref @Class.G.%T.as_type.loc10_25.1 (%T.as_type) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, %T.loc5_14.2 [symbolic = %T.loc5_14.1 (constants.%T.035)]
|
||||
// CHECK:STDOUT: %T.as_type.loc14_10.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc14_10: type = converted %T.ref, %T.as_type.loc14_10.1 [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc14_8: @Class.%Class.elem (%Class.elem) = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc14: @Class.%Class.elem (%Class.elem) = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc15_1.1: <witness> = complete_type_witness constants.%struct_type.n [symbolic = %complete_type.loc15_1.2 (constants.%complete_type)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc15_1.1
|
||||
// CHECK:STDOUT:
|
||||
@@ -165,7 +162,7 @@ class C(T:! Core.Copy) {
|
||||
// CHECK:STDOUT: .T = <poisoned>
|
||||
// CHECK:STDOUT: .F = %Class.F.decl
|
||||
// CHECK:STDOUT: .G = %Class.G.decl
|
||||
// CHECK:STDOUT: .n = %.loc14_8
|
||||
// CHECK:STDOUT: .n = %.loc14
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -217,7 +214,7 @@ class C(T:! Core.Copy) {
|
||||
// CHECK:STDOUT: fn(%self.param: @Class.G.%Class (%Class)) -> out %return.param: @Class.G.%T.as_type.loc10_25.1 (%T.as_type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %self.ref: @Class.G.%Class (%Class) = name_ref self, %self
|
||||
// CHECK:STDOUT: %n.ref: @Class.G.%Class.elem (%Class.elem) = name_ref n, @Class.%.loc14_8 [concrete = @Class.%.loc14_8]
|
||||
// CHECK:STDOUT: %n.ref: @Class.G.%Class.elem (%Class.elem) = name_ref n, @Class.%.loc14 [concrete = @Class.%.loc14]
|
||||
// CHECK:STDOUT: %.loc11_16.1: ref @Class.G.%T.as_type.loc10_25.1 (%T.as_type) = class_element_access %self.ref, element0
|
||||
// CHECK:STDOUT: %.loc11_16.2: @Class.G.%T.as_type.loc10_25.1 (%T.as_type) = acquire_value %.loc11_16.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_16.1: @Class.G.%.loc11_16.3 (%.023) = impl_witness_access constants.%Copy.lookup_impl_witness.58d, element0 [symbolic = %impl.elem0.loc11_16.2 (constants.%impl.elem0.594)]
|
||||
@@ -238,7 +235,7 @@ class C(T:! Core.Copy) {
|
||||
// CHECK:STDOUT: %Class.F => constants.%Class.F
|
||||
// CHECK:STDOUT: %Class.G.type => constants.%Class.G.type
|
||||
// CHECK:STDOUT: %Class.G => constants.%Class.G
|
||||
// CHECK:STDOUT: %T.as_type.loc14_10.2 => constants.%T.as_type
|
||||
// CHECK:STDOUT: %T.as_type => constants.%T.as_type
|
||||
// CHECK:STDOUT: %require_complete => constants.%require_complete.89e
|
||||
// CHECK:STDOUT: %Class => constants.%Class
|
||||
// CHECK:STDOUT: %Class.elem => constants.%Class.elem
|
||||
@@ -276,7 +273,6 @@ class C(T:! Core.Copy) {
|
||||
// CHECK:STDOUT: %C.F.type: type = fn_type @C.F, @C(%T) [symbolic]
|
||||
// CHECK:STDOUT: %C.F: %C.F.type = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %empty_struct_type [symbolic]
|
||||
// CHECK:STDOUT: %struct_type.data: type = struct_type {.data: %empty_struct_type} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.data [concrete]
|
||||
@@ -315,16 +311,14 @@ class C(T:! Core.Copy) {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %C.F.decl: @C.%C.F.type (%C.F.type) = fn_decl @C.F [symbolic = @C.%C.F (constants.%C.F)] {} {}
|
||||
// CHECK:STDOUT: %.loc13_14.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc13_14.2: type = converted %.loc13_14.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc13_11: @C.%C.elem (%C.elem) = field_decl data, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc13: @C.%C.elem (%C.elem) = field_decl data, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.data [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: .F = %C.F.decl
|
||||
// CHECK:STDOUT: .data = %.loc13_11
|
||||
// CHECK:STDOUT: .data = %.loc13
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -336,7 +330,7 @@ class C(T:! Core.Copy) {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %data.ref: @C.F.%C.elem (%C.elem) = name_ref data, @C.%.loc13_11 [concrete = @C.%.loc13_11]
|
||||
// CHECK:STDOUT: %data.ref: @C.F.%C.elem (%C.elem) = name_ref data, @C.%.loc13 [concrete = @C.%.loc13]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -224,11 +224,11 @@ fn Generic(unused T:! ()).WrongType() {}
|
||||
// CHECK:STDOUT: %Class.F: @Class.%Class.F.type (%Class.F.type) = struct_value () [symbolic = %Class.F (constants.%Class.F)]
|
||||
// CHECK:STDOUT: %Class.G.type: type = fn_type @Class.G, @Class(%T.loc5_14.1) [symbolic = %Class.G.type (constants.%Class.G.type)]
|
||||
// CHECK:STDOUT: %Class.G: @Class.%Class.G.type (%Class.G.type) = struct_value () [symbolic = %Class.G (constants.%Class.G)]
|
||||
// CHECK:STDOUT: %T.as_type.loc8_10.2: type = facet_access_type %T.loc5_14.1 [symbolic = %T.as_type.loc8_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc8_10.2 [symbolic = %require_complete (constants.%require_complete.89e)]
|
||||
// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.loc5_14.1 [symbolic = %T.as_type (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type [symbolic = %require_complete (constants.%require_complete.89e)]
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc5_14.1) [symbolic = %Class (constants.%Class)]
|
||||
// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type.loc8_10.2 [symbolic = %Class.elem (constants.%Class.elem)]
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Class.%T.as_type.loc8_10.2 (%T.as_type)} [symbolic = %struct_type.n (constants.%struct_type.n)]
|
||||
// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.as_type [symbolic = %Class.elem (constants.%Class.elem)]
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Class.%T.as_type (%T.as_type)} [symbolic = %struct_type.n (constants.%struct_type.n)]
|
||||
// CHECK:STDOUT: %complete_type.loc9_1.2: <witness> = complete_type_witness %struct_type.n [symbolic = %complete_type.loc9_1.2 (constants.%complete_type)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
@@ -271,10 +271,7 @@ fn Generic(unused T:! ()).WrongType() {}
|
||||
// CHECK:STDOUT: %return.param.loc7: ref @Class.G.%T.as_type.loc7_25.1 (%T.as_type) = out_param call_param1
|
||||
// CHECK:STDOUT: %return.loc7: ref @Class.G.%T.as_type.loc7_25.1 (%T.as_type) = return_slot %return.param.loc7
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, %T.loc5_14.2 [symbolic = %T.loc5_14.1 (constants.%T.035)]
|
||||
// CHECK:STDOUT: %T.as_type.loc8_10.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc8_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc8_10: type = converted %T.ref, %T.as_type.loc8_10.1 [symbolic = %T.as_type.loc8_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc8_8: @Class.%Class.elem (%Class.elem) = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc8: @Class.%Class.elem (%Class.elem) = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc9_1.1: <witness> = complete_type_witness constants.%struct_type.n [symbolic = %complete_type.loc9_1.2 (constants.%complete_type)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc9_1.1
|
||||
// CHECK:STDOUT:
|
||||
@@ -283,7 +280,7 @@ fn Generic(unused T:! ()).WrongType() {}
|
||||
// CHECK:STDOUT: .T = <poisoned>
|
||||
// CHECK:STDOUT: .F = %Class.F.decl
|
||||
// CHECK:STDOUT: .G = %Class.G.decl
|
||||
// CHECK:STDOUT: .n = %.loc8_8
|
||||
// CHECK:STDOUT: .n = %.loc8
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -335,7 +332,7 @@ fn Generic(unused T:! ()).WrongType() {}
|
||||
// CHECK:STDOUT: fn(%self.param.loc15: @Class.G.%Class (%Class)) -> out %return.param.loc15: @Class.G.%T.as_type.loc7_25.1 (%T.as_type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %self.ref: @Class.G.%Class (%Class) = name_ref self, %self.loc15
|
||||
// CHECK:STDOUT: %n.ref: @Class.G.%Class.elem (%Class.elem) = name_ref n, @Class.%.loc8_8 [concrete = @Class.%.loc8_8]
|
||||
// CHECK:STDOUT: %n.ref: @Class.G.%Class.elem (%Class.elem) = name_ref n, @Class.%.loc8 [concrete = @Class.%.loc8]
|
||||
// CHECK:STDOUT: %.loc16_14.1: ref @Class.G.%T.as_type.loc7_25.1 (%T.as_type) = class_element_access %self.ref, element0
|
||||
// CHECK:STDOUT: %.loc16_14.2: @Class.G.%T.as_type.loc7_25.1 (%T.as_type) = acquire_value %.loc16_14.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc16_14.1: @Class.G.%.loc16_14.3 (%.023) = impl_witness_access constants.%Copy.lookup_impl_witness.58d, element0 [symbolic = %impl.elem0.loc16_14.2 (constants.%impl.elem0.594)]
|
||||
@@ -356,7 +353,7 @@ fn Generic(unused T:! ()).WrongType() {}
|
||||
// CHECK:STDOUT: %Class.F => constants.%Class.F
|
||||
// CHECK:STDOUT: %Class.G.type => constants.%Class.G.type
|
||||
// CHECK:STDOUT: %Class.G => constants.%Class.G
|
||||
// CHECK:STDOUT: %T.as_type.loc8_10.2 => constants.%T.as_type
|
||||
// CHECK:STDOUT: %T.as_type => constants.%T.as_type
|
||||
// CHECK:STDOUT: %require_complete => constants.%require_complete.89e
|
||||
// CHECK:STDOUT: %Class => constants.%Class
|
||||
// CHECK:STDOUT: %Class.elem => constants.%Class.elem
|
||||
|
||||
+10
-13
@@ -71,10 +71,10 @@ fn Test() -> i32 {
|
||||
// CHECK:STDOUT: %Inner.bcf: type = class_type @Inner, @Inner(%T.035) [symbolic]
|
||||
// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.035 [symbolic]
|
||||
// CHECK:STDOUT: %require_complete.89e: <witness> = require_complete_type %T.as_type [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.3b9bb5.2: type = pattern_type %T.as_type [symbolic]
|
||||
// CHECK:STDOUT: %Inner.elem.841: type = unbound_element_type %Inner.bcf, %T.as_type [symbolic]
|
||||
// CHECK:STDOUT: %struct_type.n.50e: type = struct_type {.n: %T.as_type} [symbolic]
|
||||
// CHECK:STDOUT: %complete_type.06d: <witness> = complete_type_witness %struct_type.n.50e [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.3b9bb5.2: type = pattern_type %T.as_type [symbolic]
|
||||
// CHECK:STDOUT: %.d79: Core.Form = init_form %Inner.bcf [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.611: type = pattern_type %Inner.bcf [symbolic]
|
||||
// CHECK:STDOUT: %Outer.F.type.2fb: type = fn_type @Outer.F, @Outer(%T.035) [symbolic]
|
||||
@@ -233,25 +233,22 @@ fn Test() -> i32 {
|
||||
// CHECK:STDOUT: generic class @Inner(@Outer.%T.loc4_14.2: %Copy.type) {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %T: %Copy.type = symbolic_binding T, 0 [symbolic = %T (constants.%T.035)]
|
||||
// CHECK:STDOUT: %T.as_type.loc6_12.2: type = facet_access_type %T [symbolic = %T.as_type.loc6_12.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc6_12.2 [symbolic = %require_complete (constants.%require_complete.89e)]
|
||||
// CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic = %T.as_type (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type [symbolic = %require_complete (constants.%require_complete.89e)]
|
||||
// CHECK:STDOUT: %Inner: type = class_type @Inner, @Inner(%T) [symbolic = %Inner (constants.%Inner.bcf)]
|
||||
// CHECK:STDOUT: %Inner.elem: type = unbound_element_type %Inner, %T.as_type.loc6_12.2 [symbolic = %Inner.elem (constants.%Inner.elem.841)]
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Inner.%T.as_type.loc6_12.2 (%T.as_type)} [symbolic = %struct_type.n (constants.%struct_type.n.50e)]
|
||||
// CHECK:STDOUT: %Inner.elem: type = unbound_element_type %Inner, %T.as_type [symbolic = %Inner.elem (constants.%Inner.elem.841)]
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: @Inner.%T.as_type (%T.as_type)} [symbolic = %struct_type.n (constants.%struct_type.n.50e)]
|
||||
// CHECK:STDOUT: %complete_type.loc7_3.2: <witness> = complete_type_witness %struct_type.n [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.06d)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %T.ref: %Copy.type = name_ref T, @Outer.%T.loc4_14.2 [symbolic = %T (constants.%T.035)]
|
||||
// CHECK:STDOUT: %T.as_type.loc6_12.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc6_12.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc6_12: type = converted %T.ref, %T.as_type.loc6_12.1 [symbolic = %T.as_type.loc6_12.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc6_10: @Inner.%Inner.elem (%Inner.elem.841) = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc6: @Inner.%Inner.elem (%Inner.elem.841) = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc7_3.1: <witness> = complete_type_witness constants.%struct_type.n.50e [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.06d)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc7_3.1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%Inner.bcf
|
||||
// CHECK:STDOUT: .T = <poisoned>
|
||||
// CHECK:STDOUT: .n = %.loc6_10
|
||||
// CHECK:STDOUT: .n = %.loc6
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -329,7 +326,7 @@ fn Test() -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %Inner.350 = ref_binding c, %c.var
|
||||
// CHECK:STDOUT: %c.ref: ref %Inner.350 = name_ref c, %c
|
||||
// CHECK:STDOUT: %n.ref: %Inner.elem.117 = name_ref n, @Inner.%.loc6_10 [concrete = @Inner.%.loc6_10]
|
||||
// CHECK:STDOUT: %n.ref: %Inner.elem.117 = name_ref n, @Inner.%.loc6 [concrete = @Inner.%.loc6]
|
||||
// CHECK:STDOUT: %.loc14_11.1: ref %i32 = class_element_access %c.ref, element0
|
||||
// CHECK:STDOUT: %.loc14_11.2: %i32 = acquire_value %.loc14_11.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc14: %.348 = impl_witness_access constants.%Copy.impl_witness.30d, element0 [concrete = constants.%Int.as.Copy.impl.Op.44b]
|
||||
@@ -371,7 +368,7 @@ fn Test() -> i32 {
|
||||
// CHECK:STDOUT: specific @Inner(constants.%T.035) {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %T => constants.%T.035
|
||||
// CHECK:STDOUT: %T.as_type.loc6_12.2 => constants.%T.as_type
|
||||
// CHECK:STDOUT: %T.as_type => constants.%T.as_type
|
||||
// CHECK:STDOUT: %require_complete => constants.%require_complete.89e
|
||||
// CHECK:STDOUT: %Inner => constants.%Inner.bcf
|
||||
// CHECK:STDOUT: %Inner.elem => constants.%Inner.elem.841
|
||||
@@ -400,7 +397,7 @@ fn Test() -> i32 {
|
||||
// CHECK:STDOUT: specific @Inner(constants.%Copy.facet.d1a) {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %T => constants.%Copy.facet.d1a
|
||||
// CHECK:STDOUT: %T.as_type.loc6_12.2 => constants.%i32
|
||||
// CHECK:STDOUT: %T.as_type => constants.%i32
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.f8a
|
||||
// CHECK:STDOUT: %Inner => constants.%Inner.350
|
||||
// CHECK:STDOUT: %Inner.elem => constants.%Inner.elem.117
|
||||
|
||||
@@ -621,9 +621,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @D {
|
||||
// CHECK:STDOUT: %i32.loc5: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5: %D.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc6: %D.elem = field_decl b, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a.b.501 [concrete = constants.%complete_type.705]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -110,7 +110,6 @@ fn Run() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Field {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc8: %Field.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.x [concrete = constants.%complete_type.1ec]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -57,8 +57,6 @@ fn Run() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Cycle {
|
||||
// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, file.%Cycle.decl [concrete = constants.%Cycle]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Cycle.ref [concrete = constants.%ptr]
|
||||
// CHECK:STDOUT: %.loc5: %Cycle.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -90,9 +90,6 @@ fn Run() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Cycle {
|
||||
// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, file.%Cycle.decl.loc4 [concrete = constants.%Cycle]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Cycle.ref [concrete = constants.%ptr]
|
||||
// CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %ptr} [concrete = constants.%struct_type.b]
|
||||
// CHECK:STDOUT: %.loc10: %Cycle.elem = field_decl c, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.c [concrete = constants.%complete_type.3fc]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -175,7 +175,6 @@ class Derived {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Base {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4: %Base.elem = field_decl b, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.b.0a3 [concrete = constants.%complete_type.ba8]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -188,7 +187,6 @@ class Derived {
|
||||
// CHECK:STDOUT: class @Derived {
|
||||
// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [concrete = constants.%Base]
|
||||
// CHECK:STDOUT: %.loc8: %Derived.elem.b58 = base_decl %Base.ref, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc10: %Derived.elem.683 = field_decl d, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.base.d.81a [concrete = constants.%complete_type.3b4]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -310,7 +308,6 @@ class Derived {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Derived {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc7: %Derived.elem = field_decl d, element0 [concrete]
|
||||
// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [concrete = constants.%Base]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.d [concrete = constants.%complete_type.860]
|
||||
|
||||
@@ -109,11 +109,8 @@ fn Access(p: Derived*) -> i32* {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Base {
|
||||
// CHECK:STDOUT: %i32.loc16: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc16: %Base.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc17: %Base.elem = field_decl b, element1 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc18: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc18: %Base.elem = field_decl c, element2 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a.b.c [concrete = constants.%complete_type.ebc]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -128,9 +125,7 @@ fn Access(p: Derived*) -> i32* {
|
||||
// CHECK:STDOUT: class @Derived {
|
||||
// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [concrete = constants.%Base]
|
||||
// CHECK:STDOUT: %.loc22: %Derived.elem.029 = base_decl %Base.ref, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc24: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc24: %Derived.elem.530 = field_decl d, element1 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc25: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc25: %Derived.elem.530 = field_decl e, element2 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.base.d.e.b4b [concrete = constants.%complete_type.ea9]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -117,7 +117,6 @@ fn Call(p: Derived*) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Base {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc16: %Base.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %Base.F.decl: %Base.F.type = fn_decl @Base.F [concrete = constants.%Base.F] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.101 = ref_param_pattern [concrete]
|
||||
|
||||
@@ -99,9 +99,7 @@ fn Run() {
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [concrete = constants.%Base]
|
||||
// CHECK:STDOUT: %self: %Base = value_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %i32.loc8: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc8: %Base.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc9: %Base.elem = field_decl unused_y, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.x.unused_y [concrete = constants.%complete_type.cf1]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -46,6 +46,7 @@ fn Call(p: Derived*) -> i32 {
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.fd7: <witness> = complete_type_witness %struct_type.a [concrete]
|
||||
@@ -53,7 +54,6 @@ fn Call(p: Derived*) -> i32 {
|
||||
// CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Base [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.101: type = pattern_type %Base [concrete]
|
||||
// CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Derived.SelfBase.type: type = fn_type @Derived.SelfBase [concrete]
|
||||
// CHECK:STDOUT: %Derived.SelfBase: %Derived.SelfBase.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Derived.RefSelfBase.type: type = fn_type @Derived.RefSelfBase [concrete]
|
||||
@@ -162,7 +162,6 @@ fn Call(p: Derived*) -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Base {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc16: %Base.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a [concrete = constants.%complete_type.fd7]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
+2
-5
@@ -34,13 +34,13 @@ fn MakeReorder(n: i32, next: Class*) -> Class {
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Class.elem.762: type = unbound_element_type %Class, %i32 [concrete]
|
||||
// CHECK:STDOUT: %ptr.8e5: type = ptr_type %Class [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.018: type = pattern_type %ptr.8e5 [concrete]
|
||||
// CHECK:STDOUT: %Class.elem.f74: type = unbound_element_type %Class, %ptr.8e5 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.n.next: type = struct_type {.n: %i32, .next: %ptr.8e5} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.bf0: <witness> = complete_type_witness %struct_type.n.next [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.018: type = pattern_type %ptr.8e5 [concrete]
|
||||
// CHECK:STDOUT: %.cff: Core.Form = init_form %Class [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.904: type = pattern_type %Class [concrete]
|
||||
// CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete]
|
||||
@@ -141,10 +141,7 @@ fn MakeReorder(n: i32, next: Class*) -> Class {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Class {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc16: %Class.elem.762 = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Class.ref [concrete = constants.%ptr.8e5]
|
||||
// CHECK:STDOUT: %.loc17: %Class.elem.f74 = field_decl next, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n.next [concrete = constants.%complete_type.bf0]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -94,9 +94,7 @@ fn MakeOuter() -> Outer {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Inner {
|
||||
// CHECK:STDOUT: %i32.loc16: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc16: %Inner.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc17: %Inner.elem = field_decl b, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a.b [concrete = constants.%complete_type.705]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -108,9 +106,7 @@ fn MakeOuter() -> Outer {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Outer {
|
||||
// CHECK:STDOUT: %Inner.ref.loc23: type = name_ref Inner, file.%Inner.decl [concrete = constants.%Inner]
|
||||
// CHECK:STDOUT: %.loc23: %Outer.elem = field_decl c, element0 [concrete]
|
||||
// CHECK:STDOUT: %Inner.ref.loc24: type = name_ref Inner, file.%Inner.decl [concrete = constants.%Inner]
|
||||
// CHECK:STDOUT: %.loc24: %Outer.elem = field_decl d, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.c.d.8f4 [concrete = constants.%complete_type.3ed]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
-1
@@ -143,7 +143,6 @@ class A {
|
||||
// CHECK:STDOUT: %return.param: ref %B = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %B = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc23: %B.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n.033 [concrete = constants.%complete_type.54b]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -30,9 +30,9 @@ fn Class(T:! type).F[unused self: Self](unused n: T) {}
|
||||
// CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic]
|
||||
// CHECK:STDOUT: %require_complete.944: <witness> = require_complete_type %T [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic]
|
||||
// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.466: type = pattern_type %Class [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic]
|
||||
// CHECK:STDOUT: %Class.F.type: type = fn_type @Class.F, @Class(%T) [symbolic]
|
||||
// CHECK:STDOUT: %Class.F: %Class.F.type = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T} [symbolic]
|
||||
@@ -98,7 +98,6 @@ fn Class(T:! type).F[unused self: Self](unused n: T) {}
|
||||
// CHECK:STDOUT: %complete_type.loc18_1.2: <witness> = complete_type_witness %struct_type.a [symbolic = %complete_type.loc18_1.2 (constants.%complete_type)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc15_14.2 [symbolic = %T.loc15_14.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc16: @Class.%Class.elem (%Class.elem) = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %Class.F.decl: @Class.%Class.F.type (%Class.F.type) = fn_decl @Class.F [symbolic = @Class.%Class.F (constants.%Class.F)] {
|
||||
// CHECK:STDOUT: %self.param_patt: @Class.F.%pattern_type.loc17_12 (%pattern_type.466) = value_param_pattern [concrete]
|
||||
|
||||
@@ -344,7 +344,6 @@ fn CallGOnInitializingExpr() -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.ref: %Class.F.type = name_ref F, %Class.F.decl [concrete = constants.%Class.F]
|
||||
// CHECK:STDOUT: %A: %Class.F.type = alias_binding A, %F.ref [concrete = constants.%Class.F]
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc21: %Class.elem = field_decl k, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.k.0bf [concrete = constants.%complete_type.954]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
+1
-1
@@ -242,7 +242,7 @@ class C2 {
|
||||
// Failure: `C2.C1` declared after it was poisoned.
|
||||
// CHECK:STDERR: fail_declare_data_member_after_poison.carbon:[[@LINE+4]]:7: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: var C1: C2;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
var C1: C2;
|
||||
}
|
||||
|
||||
+2
-14
@@ -62,8 +62,10 @@ fn F(a: Outer*) {
|
||||
// CHECK:STDOUT: %Outer.F: %Outer.F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Inner: type = class_type @Inner [concrete]
|
||||
// CHECK:STDOUT: %ptr.78a: type = ptr_type %Inner [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.565: type = pattern_type %ptr.78a [concrete]
|
||||
// CHECK:STDOUT: %Inner.elem.9c1: type = unbound_element_type %Inner, %ptr.78a [concrete]
|
||||
// CHECK:STDOUT: %ptr.56b: type = ptr_type %Outer [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.cd9: type = pattern_type %ptr.56b [concrete]
|
||||
// CHECK:STDOUT: %Inner.elem.9e0: type = unbound_element_type %Inner, %ptr.56b [concrete]
|
||||
// CHECK:STDOUT: %Inner.G.type: type = fn_type @Inner.G [concrete]
|
||||
// CHECK:STDOUT: %Inner.G: %Inner.G.type = struct_value () [concrete]
|
||||
@@ -92,8 +94,6 @@ fn F(a: Outer*) {
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.e55: %DefaultOrUnformed.type = facet_value %Inner, (%DefaultOrUnformed.impl_witness.ae9) [concrete]
|
||||
// CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.specific_fn.76c: <specific function> = specific_function %T.as.DefaultOrUnformed.impl.Op.83d, @T.as.DefaultOrUnformed.impl.Op(%Inner) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.565: type = pattern_type %ptr.78a [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.cd9: type = pattern_type %ptr.56b [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.bae255.4: type = fn_type @Destroy.Op.loc19_5.4 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.651ba6.4: %Destroy.Op.type.bae255.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.bae255.6: type = fn_type @Destroy.Op.loc18_5.2 [concrete]
|
||||
@@ -161,14 +161,8 @@ fn F(a: Outer*) {
|
||||
// CHECK:STDOUT: %Outer.F.decl: %Outer.F.type = fn_decl @Outer.F [concrete = constants.%Outer.F] {} {}
|
||||
// CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [concrete = constants.%Inner] {} {}
|
||||
// CHECK:STDOUT: %Outer.H.decl: %Outer.H.type = fn_decl @Outer.H [concrete = constants.%Outer.H] {} {}
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Outer [concrete = constants.%Outer]
|
||||
// CHECK:STDOUT: %ptr.loc40: type = ptr_type %Self.ref [concrete = constants.%ptr.56b]
|
||||
// CHECK:STDOUT: %.loc40: %Outer.elem.1e5 = field_decl po, element0 [concrete]
|
||||
// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [concrete = constants.%Outer]
|
||||
// CHECK:STDOUT: %ptr.loc41: type = ptr_type %Outer.ref [concrete = constants.%ptr.56b]
|
||||
// CHECK:STDOUT: %.loc41: %Outer.elem.1e5 = field_decl qo, element1 [concrete]
|
||||
// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %Inner.decl [concrete = constants.%Inner]
|
||||
// CHECK:STDOUT: %ptr.loc42: type = ptr_type %Inner.ref [concrete = constants.%ptr.78a]
|
||||
// CHECK:STDOUT: %.loc42: %Outer.elem.6db = field_decl pi, element2 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.po.qo.pi [concrete = constants.%complete_type.c34]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -185,14 +179,8 @@ fn F(a: Outer*) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Inner {
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Inner [concrete = constants.%Inner]
|
||||
// CHECK:STDOUT: %ptr.loc23: type = ptr_type %Self.ref [concrete = constants.%ptr.78a]
|
||||
// CHECK:STDOUT: %.loc23: %Inner.elem.9c1 = field_decl pi, element0 [concrete]
|
||||
// CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [concrete = constants.%Outer]
|
||||
// CHECK:STDOUT: %ptr.loc24: type = ptr_type %Outer.ref [concrete = constants.%ptr.56b]
|
||||
// CHECK:STDOUT: %.loc24: %Inner.elem.9e0 = field_decl po, element1 [concrete]
|
||||
// CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [concrete = constants.%Inner]
|
||||
// CHECK:STDOUT: %ptr.loc25: type = ptr_type %Inner.ref [concrete = constants.%ptr.78a]
|
||||
// CHECK:STDOUT: %.loc25: %Inner.elem.9c1 = field_decl qi, element2 [concrete]
|
||||
// CHECK:STDOUT: %Inner.G.decl: %Inner.G.type = fn_decl @Inner.G [concrete = constants.%Inner.G] {} {}
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.pi.po.qi [concrete = constants.%complete_type.486]
|
||||
|
||||
+1
-2
@@ -38,6 +38,7 @@ fn G(o: Outer) {
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Inner.elem: type = unbound_element_type %Inner, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.54b: <witness> = complete_type_witness %struct_type.n [concrete]
|
||||
@@ -45,7 +46,6 @@ fn G(o: Outer) {
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.86a: type = pattern_type %Inner [concrete]
|
||||
// CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
|
||||
@@ -141,7 +141,6 @@ fn G(o: Outer) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Inner {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc17: %Inner.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type.54b]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -169,7 +169,6 @@ class A {
|
||||
// CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: %A.AF.decl: %A.AF.type = fn_decl @A.AF [concrete = constants.%A.AF] {} {}
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc50: %A.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a.ba9 [concrete = constants.%complete_type.fd7]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -185,7 +184,6 @@ class A {
|
||||
// CHECK:STDOUT: class @B {
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: %B.BF.decl: %B.BF.type = fn_decl @B.BF [concrete = constants.%B.BF] {} {}
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc20: %B.elem = field_decl b, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.b.0a3 [concrete = constants.%complete_type.ba8]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -204,7 +202,6 @@ class A {
|
||||
// CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %D.DF.decl: %D.DF.type = fn_decl @D.DF [concrete = constants.%D.DF] {} {}
|
||||
// CHECK:STDOUT: %C.CF.decl: %C.CF.type = fn_decl @C.CF [concrete = constants.%C.CF] {} {}
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc46: %C.elem = field_decl c, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.c.b66 [concrete = constants.%complete_type.836]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -224,7 +221,6 @@ class A {
|
||||
// CHECK:STDOUT: class @D {
|
||||
// CHECK:STDOUT: %D.F.decl: %D.F.type = fn_decl @D.F [concrete = constants.%D.F] {} {}
|
||||
// CHECK:STDOUT: %D.DF.decl: %D.DF.type = fn_decl @D.DF [concrete = constants.%D.DF] {} {}
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc28: %D.elem = field_decl d, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.d.b7b [concrete = constants.%complete_type.860]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -154,7 +154,6 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) {
|
||||
// CHECK:STDOUT: %return.param.loc17: ref %tuple.type.d07 = out_param call_param2
|
||||
// CHECK:STDOUT: %return.loc17: ref %tuple.type.d07 = return_slot %return.param.loc17
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc18: %Class.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type.54b]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -156,7 +156,6 @@ class Class {
|
||||
// CHECK:STDOUT: %return.param.loc6: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return.loc6: ref %i32 = return_slot %return.param.loc6
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc8: %Class.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type.54b]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -131,8 +131,6 @@ fn Class.F[self: Self]() -> i32 {
|
||||
// CHECK:STDOUT: %return.param: ref %Class = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %Class = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Self.ref [concrete = constants.%ptr.8e5]
|
||||
// CHECK:STDOUT: %.loc22: %Class.elem = field_decl p, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.p [concrete = constants.%complete_type.141]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
+8
-10
@@ -1134,7 +1134,7 @@ fn Base.F[ref self: Base]() {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %Base [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.101: type = pattern_type %Base [concrete]
|
||||
// CHECK:STDOUT: %Base.F.type.c66019.1: type = fn_type @Base.F.loc7 [concrete]
|
||||
// CHECK:STDOUT: %Base.F.811e28.1: %Base.F.type.c66019.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_tuple.type} [concrete]
|
||||
@@ -1149,8 +1149,8 @@ fn Base.F[ref self: Base]() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Base.decl: type = class_decl @Base [concrete = constants.%Base] {} {}
|
||||
// CHECK:STDOUT: %Base.F.decl: %Base.F.type.c66019.2 = fn_decl @Base.F.loc17 [concrete = constants.%Base.F.811e28.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type = at_binding_pattern self, %self.param_patt [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.101 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.101 = at_binding_pattern self, %self.param_patt [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0
|
||||
// CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [concrete = constants.%Base]
|
||||
@@ -1159,12 +1159,10 @@ fn Base.F[ref self: Base]() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Base {
|
||||
// CHECK:STDOUT: %.loc5_11.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc5_8: %Base.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc5: %Base.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %Base.F.decl: %Base.F.type.c66019.1 = fn_decl @Base.F.loc7 [concrete = constants.%Base.F.811e28.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type = at_binding_pattern self, %self.param_patt [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.101 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.101 = at_binding_pattern self, %self.param_patt [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [concrete = constants.%Base]
|
||||
@@ -1175,7 +1173,7 @@ fn Base.F[ref self: Base]() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%Base
|
||||
// CHECK:STDOUT: .a = %.loc5_8
|
||||
// CHECK:STDOUT: .a = %.loc5
|
||||
// CHECK:STDOUT: .F = %Base.F.decl
|
||||
// CHECK:STDOUT: .Base = <poisoned>
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1185,7 +1183,7 @@ fn Base.F[ref self: Base]() {
|
||||
// CHECK:STDOUT: fn @Base.F.loc17(%self.param: ref %Base) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %self.ref: ref %Base = name_ref self, %self
|
||||
// CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc5_8 [concrete = @Base.%.loc5_8]
|
||||
// CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc5 [concrete = @Base.%.loc5]
|
||||
// CHECK:STDOUT: %.loc18_7: ref %empty_tuple.type = class_element_access %self.ref, element0
|
||||
// CHECK:STDOUT: %.loc18_13.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc18_13.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
|
||||
|
||||
@@ -637,7 +637,7 @@ fn G() {
|
||||
// CHECK:STDOUT: %a.param: <error> = value_param call_param1
|
||||
// CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
|
||||
// CHECK:STDOUT: %T.ref.loc21_51: %Class = name_ref T, %T.loc21_7.2 [symbolic = %T.loc21_7.1 (constants.%T.d7d)]
|
||||
// CHECK:STDOUT: %t.ref: %Class.elem = name_ref t, @Class.%.loc5_8 [concrete = @Class.%.loc5_8]
|
||||
// CHECK:STDOUT: %t.ref: %Class.elem = name_ref t, @Class.%.loc5 [concrete = @Class.%.loc5]
|
||||
// CHECK:STDOUT: %.loc21_52.2: ref type = class_element_access %T.ref.loc21_51, element0 [symbolic = %.loc21_52.1 (constants.%.208)]
|
||||
// CHECK:STDOUT: %.loc21_52.3: type = acquire_value %.loc21_52.2
|
||||
// CHECK:STDOUT: }
|
||||
@@ -657,14 +657,13 @@ fn G() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Class {
|
||||
// CHECK:STDOUT: %.loc5_10: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %.loc5_8: %Class.elem = field_decl t, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc5: %Class.elem = field_decl t, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.t [concrete = constants.%complete_type.509]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%Class
|
||||
// CHECK:STDOUT: .t = %.loc5_8
|
||||
// CHECK:STDOUT: .t = %.loc5
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @HoldsType(%T.loc8_18.2: %Class) {
|
||||
|
||||
+2
-2
@@ -134,8 +134,8 @@ fn F(T: Z) {
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %I.type [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.9d9: type = pattern_type %I.type [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %I.type [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%c.param: %C) {
|
||||
@@ -168,7 +168,7 @@ fn F(T: Z) {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.9d9 = value_binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.ref: %C = name_ref c, %c
|
||||
// CHECK:STDOUT: %ij.ref: %C.elem = name_ref ij, @C.%.loc7_9 [concrete = @C.%.loc7_9]
|
||||
// CHECK:STDOUT: %ij.ref: %C.elem = name_ref ij, @C.%.loc7 [concrete = @C.%.loc7]
|
||||
// CHECK:STDOUT: %.loc21_22.1: ref %facet_type = class_element_access %c.ref, element0
|
||||
// CHECK:STDOUT: %.loc21_22.2: %facet_type = acquire_value %.loc21_22.1
|
||||
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
|
||||
|
||||
+7
-15
@@ -267,7 +267,7 @@ fn Read(y:! Core.IntLiteral()) {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc4_36.1: type = splice_block %.loc4_36.3 [concrete = Core.IntLiteral] {
|
||||
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39]
|
||||
// CHECK:STDOUT: %Core.ref.loc4: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
|
||||
// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %.loc4_36.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
|
||||
@@ -387,11 +387,11 @@ fn Read(y:! Core.IntLiteral()) {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %IntRange.Make.type: type = fn_type @IntRange.Make, @IntRange(%N.loc4_17.1) [symbolic = %IntRange.Make.type (constants.%IntRange.Make.type.1df)]
|
||||
// CHECK:STDOUT: %IntRange.Make: @IntRange.%IntRange.Make.type (%IntRange.Make.type.1df) = struct_value () [symbolic = %IntRange.Make (constants.%IntRange.Make.8a9)]
|
||||
// CHECK:STDOUT: %Int.loc22_32.2: type = class_type @Int, @Int(%N.loc4_17.1) [symbolic = %Int.loc22_32.2 (constants.%Int.fc6021.1)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Int.loc22_32.2 [symbolic = %require_complete (constants.%require_complete.9019d7.1)]
|
||||
// CHECK:STDOUT: %Int: type = class_type @Int, @Int(%N.loc4_17.1) [symbolic = %Int (constants.%Int.fc6021.1)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Int [symbolic = %require_complete (constants.%require_complete.9019d7.1)]
|
||||
// CHECK:STDOUT: %IntRange: type = class_type @IntRange, @IntRange(%N.loc4_17.1) [symbolic = %IntRange (constants.%IntRange.265)]
|
||||
// CHECK:STDOUT: %IntRange.elem: type = unbound_element_type %IntRange, %Int.loc22_32.2 [symbolic = %IntRange.elem (constants.%IntRange.elem.541)]
|
||||
// CHECK:STDOUT: %struct_type.start.end: type = struct_type {.start: @IntRange.%Int.loc22_32.2 (%Int.fc6021.1), .end: @IntRange.%Int.loc22_32.2 (%Int.fc6021.1)} [symbolic = %struct_type.start.end (constants.%struct_type.start.end.ff1)]
|
||||
// CHECK:STDOUT: %IntRange.elem: type = unbound_element_type %IntRange, %Int [symbolic = %IntRange.elem (constants.%IntRange.elem.541)]
|
||||
// CHECK:STDOUT: %struct_type.start.end: type = struct_type {.start: @IntRange.%Int (%Int.fc6021.1), .end: @IntRange.%Int (%Int.fc6021.1)} [symbolic = %struct_type.start.end (constants.%struct_type.start.end.ff1)]
|
||||
// CHECK:STDOUT: %complete_type.loc24_1.2: <witness> = complete_type_witness %struct_type.start.end [symbolic = %complete_type.loc24_1.2 (constants.%complete_type.427)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
@@ -456,15 +456,7 @@ fn Read(y:! Core.IntLiteral()) {
|
||||
// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_85.2
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.ref.loc22: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %Int.ref.loc22: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %N.ref.loc22: Core.IntLiteral = name_ref N, %N.loc4_17.2 [symbolic = %N.loc4_17.1 (constants.%N)]
|
||||
// CHECK:STDOUT: %Int.loc22_32.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc22_32.2 (constants.%Int.fc6021.1)]
|
||||
// CHECK:STDOUT: %.loc22: @IntRange.%IntRange.elem (%IntRange.elem.541) = field_decl start, element0 [concrete]
|
||||
// CHECK:STDOUT: %Core.ref.loc23: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %Int.ref.loc23: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %N.ref.loc23: Core.IntLiteral = name_ref N, %N.loc4_17.2 [symbolic = %N.loc4_17.1 (constants.%N)]
|
||||
// CHECK:STDOUT: %Int.loc23: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc22_32.2 (constants.%Int.fc6021.1)]
|
||||
// CHECK:STDOUT: %.loc23: @IntRange.%IntRange.elem (%IntRange.elem.541) = field_decl end, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc24_1.1: <witness> = complete_type_witness constants.%struct_type.start.end.ff1 [symbolic = %complete_type.loc24_1.2 (constants.%complete_type.427)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc24_1.1
|
||||
@@ -745,7 +737,7 @@ fn Read(y:! Core.IntLiteral()) {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %IntRange.Make.type => constants.%IntRange.Make.type.1df
|
||||
// CHECK:STDOUT: %IntRange.Make => constants.%IntRange.Make.8a9
|
||||
// CHECK:STDOUT: %Int.loc22_32.2 => constants.%Int.fc6021.1
|
||||
// CHECK:STDOUT: %Int => constants.%Int.fc6021.1
|
||||
// CHECK:STDOUT: %require_complete => constants.%require_complete.9019d7.1
|
||||
// CHECK:STDOUT: %IntRange => constants.%IntRange.265
|
||||
// CHECK:STDOUT: %IntRange.elem => constants.%IntRange.elem.541
|
||||
@@ -814,7 +806,7 @@ fn Read(y:! Core.IntLiteral()) {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %IntRange.Make.type => constants.%IntRange.Make.type.045
|
||||
// CHECK:STDOUT: %IntRange.Make => constants.%IntRange.Make.3e9
|
||||
// CHECK:STDOUT: %Int.loc22_32.2 => constants.%i32
|
||||
// CHECK:STDOUT: %Int => constants.%i32
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.f8a
|
||||
// CHECK:STDOUT: %IntRange => constants.%IntRange.a89
|
||||
// CHECK:STDOUT: %IntRange.elem => constants.%IntRange.elem.a58
|
||||
|
||||
@@ -146,9 +146,6 @@ fn G() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_100: Core.IntLiteral = int_value 100 [concrete = constants.%int_100]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_100, %i32 [concrete = constants.%array_type]
|
||||
// CHECK:STDOUT: %.loc19: %C.elem = field_decl arr, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.arr.5f2 [concrete = constants.%complete_type.22a]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -165,7 +165,6 @@ fn G(p: B*) { F(B, p); }
|
||||
// CHECK:STDOUT: %complete_type.loc8_1.2: <witness> = complete_type_witness %struct_type.v [symbolic = %complete_type.loc8_1.2 (constants.%complete_type.136)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_10.2 [symbolic = %T.loc6_10.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc7: @A.%A.elem (%A.elem.8a2) = field_decl v, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc8_1.1: <witness> = complete_type_witness constants.%struct_type.v.a4d [symbolic = %complete_type.loc8_1.2 (constants.%complete_type.136)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc8_1.1
|
||||
|
||||
@@ -135,7 +135,6 @@ class C(C:! type) {
|
||||
// CHECK:STDOUT: %complete_type.loc7_3.2: <witness> = complete_type_witness %struct_type.x [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc5_12.2 [symbolic = %T.loc5_12.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc6: @C.%C.elem (%C.elem.d15) = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.loc7_3.1: <witness> = complete_type_witness constants.%struct_type.x.0c5 [symbolic = %complete_type.loc7_3.2 (constants.%complete_type.735)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc7_3.1
|
||||
|
||||
@@ -230,7 +230,6 @@ fn Test(d: D) -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc14: %C.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: impl_decl @C.as.ImplicitAs.impl [concrete] {} {
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
||||
|
||||
@@ -217,7 +217,6 @@ fn Test(e: E) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc10: %C.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type.54b]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -406,7 +405,6 @@ fn Test(e: E) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @D {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc10: %D.elem = field_decl m, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.m [concrete = constants.%complete_type.218]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
@@ -589,7 +587,6 @@ fn Test(e: E) {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @E {
|
||||
// CHECK:STDOUT: %F.decl: type = class_decl @F.loc10 [concrete = constants.%F.c40] {} {}
|
||||
// CHECK:STDOUT: %F.ref: type = name_ref F, %F.decl [concrete = constants.%F.c40]
|
||||
// CHECK:STDOUT: %.loc11: %E.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n.cae [concrete = constants.%complete_type.7a8]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -164,6 +164,7 @@ fn F[template T:! Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.54b: <witness> = complete_type_witness %struct_type.n [concrete]
|
||||
@@ -172,7 +173,6 @@ fn F[template T:! Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: %pattern_type.7c7: type = pattern_type %C [concrete]
|
||||
// CHECK:STDOUT: %c: %C = symbolic_binding c, 0, template [template]
|
||||
// CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
|
||||
@@ -217,7 +217,6 @@ fn F[template T:! Core.Destroy](x: T) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5: %C.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type.54b]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -55,14 +55,6 @@ fn F(a: if true then i32 else f64);
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_class.carbon:[[@LINE+12]]:10: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo]
|
||||
// CHECK:STDERR: var n: if true then i32 else f64;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_class.carbon:[[@LINE+8]]:18: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo]
|
||||
// CHECK:STDERR: var n: if true then i32 else f64;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_class.carbon:[[@LINE+4]]:10: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` [SemanticsTodo]
|
||||
// CHECK:STDERR: var n: if true then i32 else f64;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -96,12 +88,9 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %true: bool = bool_literal true [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
|
||||
// CHECK:STDOUT: if %true br !if.expr.then else br !if.expr.else
|
||||
// CHECK:STDOUT: complete_type_witness = invalid
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
|
||||
@@ -76,6 +76,7 @@ class X(U:! type) {
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Param.elem: type = unbound_element_type %Param, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.x.ed6: type = struct_type {.x: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.1ec: <witness> = complete_type_witness %struct_type.x.ed6 [concrete]
|
||||
@@ -112,7 +113,6 @@ class X(U:! type) {
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b91: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
|
||||
// CHECK:STDOUT: %.9db: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b91, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.f1a [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.f1a, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
|
||||
@@ -245,7 +245,6 @@ class X(U:! type) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Param {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc9: %Param.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.x.ed6 [concrete = constants.%complete_type.1ec]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -47,6 +47,7 @@ fn Test() {
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
|
||||
// CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %X.elem: type = unbound_element_type %X, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.54b: <witness> = complete_type_witness %struct_type.n [concrete]
|
||||
@@ -55,7 +56,6 @@ fn Test() {
|
||||
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.062: type = facet_type <@ImplicitAs, @ImplicitAs(%X)> [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.f5e: <witness> = impl_witness @i32.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %.a1b: Core.Form = init_form %X [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.05f: type = pattern_type %X [concrete]
|
||||
// CHECK:STDOUT: %i32.as.ImplicitAs.impl.Convert.type: type = fn_type @i32.as.ImplicitAs.impl.Convert [concrete]
|
||||
@@ -228,7 +228,6 @@ fn Test() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @X {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc16: %X.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type.54b]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -201,7 +201,6 @@ alias C = Other.C;
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
|
||||
@@ -215,15 +214,13 @@ alias C = Other.C;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %.loc5_11.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc5_8: %C.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc5: %C.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.x [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: .x = %.loc5_8
|
||||
// CHECK:STDOUT: .x = %.loc5
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- conflict.carbon
|
||||
|
||||
+2
-5
@@ -195,7 +195,6 @@ export Poison;
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
|
||||
@@ -209,15 +208,13 @@ export Poison;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %.loc5_11.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc5_8: %C.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc5: %C.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.x [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: .x = %.loc5_8
|
||||
// CHECK:STDOUT: .x = %.loc5
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- export.carbon
|
||||
|
||||
+4
-9
@@ -123,7 +123,6 @@ var d: D = {.y = ()};
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.9be: <witness> = complete_type_witness %struct_type.x [concrete]
|
||||
@@ -143,27 +142,23 @@ var d: D = {.y = ()};
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %.loc5_11.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc5_8: %C.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc5: %C.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.x [concrete = constants.%complete_type.9be]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: .x = %.loc5_8
|
||||
// CHECK:STDOUT: .x = %.loc5
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @D {
|
||||
// CHECK:STDOUT: %.loc9_11.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc9_11.2: type = converted %.loc9_11.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc9_8: %D.elem = field_decl y, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc9: %D.elem = field_decl y, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.y [concrete = constants.%complete_type.9f4]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%D
|
||||
// CHECK:STDOUT: .y = %.loc9_8
|
||||
// CHECK:STDOUT: .y = %.loc9
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- export_import.carbon
|
||||
|
||||
+4
-9
@@ -210,7 +210,6 @@ private export C;
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.9be: <witness> = complete_type_witness %struct_type.x [concrete]
|
||||
@@ -233,27 +232,23 @@ private export C;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %.loc5_11.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc5_8: %C.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc5: %C.elem = field_decl x, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.x [concrete = constants.%complete_type.9be]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: .x = %.loc5_8
|
||||
// CHECK:STDOUT: .x = %.loc5
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @NSC {
|
||||
// CHECK:STDOUT: %.loc10_11.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc10_11.2: type = converted %.loc10_11.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc10_8: %NSC.elem = field_decl y, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc10: %NSC.elem = field_decl y, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.y [concrete = constants.%complete_type.9f4]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%NSC
|
||||
// CHECK:STDOUT: .y = %.loc10_8
|
||||
// CHECK:STDOUT: .y = %.loc10
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- export.carbon
|
||||
|
||||
@@ -43,7 +43,6 @@ export C.n;
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %empty_struct_type} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.n [concrete]
|
||||
@@ -57,15 +56,13 @@ export C.n;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %.loc5_11.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc5_8: %C.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %.loc5: %C.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: .n = %.loc5_8
|
||||
// CHECK:STDOUT: .n = %.loc5
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_b.carbon
|
||||
|
||||
@@ -273,10 +273,6 @@ var c: r#Core = {.n = 0 as Core.Int(32)};
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Core {
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc3: %Core.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type.54b]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
+25
-7
@@ -79,13 +79,9 @@ fn G[_:! type]() {}
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_class.carbon:[[@LINE+8]]:7: error: expected identifier in field declaration [ExpectedFieldIdentifier]
|
||||
// CHECK:STDERR: fail_class.carbon:[[@LINE+4]]:7: error: expected identifier in field declaration [FieldNamedUnderscore]
|
||||
// CHECK:STDERR: var _: ();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_class.carbon:[[@LINE+4]]:3: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: var _: ();
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
var _: ();
|
||||
}
|
||||
@@ -494,10 +490,32 @@ fn F() -> {} {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %struct_type._: type = struct_type {._: %empty_tuple.type} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type._ [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: complete_type_witness = invalid
|
||||
// CHECK:STDOUT: %.loc9: %C.elem = field_decl _, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type._ [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
|
||||
+1
-3
@@ -36,10 +36,10 @@ fn Foo(ptr: C*) {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %C.Member: %C.Member.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ptr.31e: type = ptr_type %C [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.506: type = pattern_type %ptr.31e [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %ptr.31e [concrete]
|
||||
// CHECK:STDOUT: %struct_type.field: type = struct_type {.field: %ptr.31e} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.field [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.506: type = pattern_type %ptr.31e [concrete]
|
||||
// CHECK:STDOUT: %Foo.type: type = fn_type @Foo [concrete]
|
||||
// CHECK:STDOUT: %Foo: %Foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -81,8 +81,6 @@ fn Foo(ptr: C*) {
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %self: %C = value_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %C.ref [concrete = constants.%ptr.31e]
|
||||
// CHECK:STDOUT: %.loc17: %C.elem = field_decl field, element0 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.field [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -136,9 +136,7 @@ fn G() -> C {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %i32.loc27_18: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc27_16: %C.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc27_30: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc27_28: %C.elem = field_decl b, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a.b.501 [concrete = constants.%complete_type.705]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -547,9 +547,7 @@ fn F0(unused n: i32) -> P.D {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @D {
|
||||
// CHECK:STDOUT: %i32.loc5_18: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_16: %D.elem = field_decl n, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc5_30: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_28: %D.elem = field_decl m, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n.m.de8 [concrete = constants.%complete_type.ea0]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
+1
-3
@@ -37,6 +37,7 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.a.b.501: type = struct_type {.a: %i32, .b: %i32} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.705: <witness> = complete_type_witness %struct_type.a.b.501 [concrete]
|
||||
@@ -62,7 +63,6 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: %.9db: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b91, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.d43: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.f1a [concrete]
|
||||
// CHECK:STDOUT: %.ff5: Core.Form = init_form %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.f1a, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.e79: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
|
||||
@@ -126,9 +126,7 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %i32.loc16: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc16: %C.elem = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %i32.loc17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc17: %C.elem = field_decl b, element1 [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a.b.501 [concrete = constants.%complete_type.705]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
+2
-6
@@ -72,13 +72,9 @@ let (x: {}, y: {}) = ({}, {});
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_in_class.carbon:[[@LINE+8]]:7: error: expected identifier in field declaration [ExpectedFieldIdentifier]
|
||||
// CHECK:STDERR: fail_in_class.carbon:[[@LINE+4]]:20: error: found tuple pattern in class `var` decl [FieldWithTuplePattern]
|
||||
// CHECK:STDERR: var (x: {}, y: {});
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_in_class.carbon:[[@LINE+4]]:3: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: var (x: {}, y: {});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var (x: {}, y: {});
|
||||
}
|
||||
|
||||
@@ -175,8 +175,6 @@ CARBON_DIAGNOSTIC_KIND(ExpectedDeclSemi)
|
||||
CARBON_DIAGNOSTIC_KIND(ExpectedDeclSemiOrDefinition)
|
||||
CARBON_DIAGNOSTIC_KIND(ExpectedAfterBase)
|
||||
CARBON_DIAGNOSTIC_KIND(ExpectedBuiltinName)
|
||||
CARBON_DIAGNOSTIC_KIND(ExpectedFieldIdentifier)
|
||||
CARBON_DIAGNOSTIC_KIND(ExpectedFieldColon)
|
||||
CARBON_DIAGNOSTIC_KIND(ImplExpectedAfterForall)
|
||||
CARBON_DIAGNOSTIC_KIND(ImplExpectedAs)
|
||||
CARBON_DIAGNOSTIC_KIND(ExpectedAssociatedConstantIdentifier)
|
||||
@@ -312,6 +310,8 @@ CARBON_DIAGNOSTIC_KIND(ClassSpecificDeclOutsideClass)
|
||||
CARBON_DIAGNOSTIC_KIND(ClassSpecificDeclPrevious)
|
||||
CARBON_DIAGNOSTIC_KIND(ClassForwardDeclaredHere)
|
||||
CARBON_DIAGNOSTIC_KIND(ClassIncompleteWithinDefinition)
|
||||
CARBON_DIAGNOSTIC_KIND(FieldNamedUnderscore)
|
||||
CARBON_DIAGNOSTIC_KIND(FieldWithTuplePattern)
|
||||
CARBON_DIAGNOSTIC_KIND(GenericVirtual)
|
||||
CARBON_DIAGNOSTIC_KIND(OverrideWithoutBase)
|
||||
CARBON_DIAGNOSTIC_KIND(OverrideWithoutVirtualInBase)
|
||||
@@ -417,7 +417,6 @@ CARBON_DIAGNOSTIC_KIND(NoPeriodSelfForDesignator)
|
||||
CARBON_DIAGNOSTIC_KIND(UsedBeforeInitialization)
|
||||
|
||||
CARBON_DIAGNOSTIC_KIND(AbstractTypeInAdaptDecl)
|
||||
CARBON_DIAGNOSTIC_KIND(AbstractTypeInFieldDecl)
|
||||
CARBON_DIAGNOSTIC_KIND(AbstractTypeInFunctionReturnType)
|
||||
CARBON_DIAGNOSTIC_KIND(AbstractTypeInInit)
|
||||
CARBON_DIAGNOSTIC_KIND(AbstractTypeInVarPattern)
|
||||
@@ -457,7 +456,6 @@ CARBON_DIAGNOSTIC_KIND(IncompleteTypeInBaseDecl)
|
||||
CARBON_DIAGNOSTIC_KIND(IncompleteTypeInBindingDecl)
|
||||
CARBON_DIAGNOSTIC_KIND(IncompleteTypeInConversion)
|
||||
CARBON_DIAGNOSTIC_KIND(IncompleteTypeInCopyWitness)
|
||||
CARBON_DIAGNOSTIC_KIND(IncompleteTypeInFieldDecl)
|
||||
CARBON_DIAGNOSTIC_KIND(IncompleteTypeInFunctionParam)
|
||||
CARBON_DIAGNOSTIC_KIND(IncompleteTypeInFunctionReturnType)
|
||||
CARBON_DIAGNOSTIC_KIND(IncompleteTypeInMonomorphization)
|
||||
|
||||
@@ -144,8 +144,8 @@ static constexpr auto DeclIntroducers = [] {
|
||||
StateKind::AssociatedConstant);
|
||||
set_contextual(Lex::TokenKind::Var, RegularContext,
|
||||
NodeKind::VariableIntroducer, StateKind::VarAsRegular);
|
||||
set_contextual(Lex::TokenKind::Var, ClassContext, NodeKind::FieldIntroducer,
|
||||
StateKind::FieldDecl);
|
||||
set_contextual(Lex::TokenKind::Var, ClassContext,
|
||||
NodeKind::VariableIntroducer, StateKind::VarAsRegular);
|
||||
|
||||
set(Lex::TokenKind::Inline, NodeKind::InlineIntroducer,
|
||||
StateKind::InlineDeclAfterIntroducer);
|
||||
|
||||
@@ -19,7 +19,7 @@ static auto HandleVar(Context& context, StateKind finish_state_kind,
|
||||
// TODO: is there a cleaner way to give VarAfterPattern access to the `var`
|
||||
// token?
|
||||
state.token = *(context.position() - 1);
|
||||
context.PushState(state, StateKind::VarAfterPatternAsVar);
|
||||
context.PushState(state, StateKind::VarAfterPattern);
|
||||
|
||||
if (returned_token.has_value()) {
|
||||
context.AddLeafNode(NodeKind::ReturnedModifier, returned_token);
|
||||
@@ -31,7 +31,7 @@ static auto HandleVar(Context& context, StateKind finish_state_kind,
|
||||
}
|
||||
|
||||
auto HandleVarAsRegular(Context& context) -> void {
|
||||
HandleVar(context, StateKind::VarFinishAsRegular);
|
||||
HandleVar(context, StateKind::VarFinish);
|
||||
}
|
||||
|
||||
auto HandleVarAsReturned(Context& context) -> void {
|
||||
@@ -49,40 +49,10 @@ auto HandleVarAsReturned(Context& context) -> void {
|
||||
}
|
||||
|
||||
context.AddLeafNode(NodeKind::VariableIntroducer, context.Consume());
|
||||
HandleVar(context, StateKind::VarFinishAsRegular, returned_token);
|
||||
HandleVar(context, StateKind::VarFinish, returned_token);
|
||||
}
|
||||
|
||||
auto HandleFieldDecl(Context& context) -> void {
|
||||
auto state = context.PopState();
|
||||
|
||||
auto identifier = context.ConsumeIf(Lex::TokenKind::Identifier);
|
||||
if (!identifier) {
|
||||
CARBON_DIAGNOSTIC(ExpectedFieldIdentifier, Error,
|
||||
"expected identifier in field declaration");
|
||||
context.emitter().Emit(*context.position(), ExpectedFieldIdentifier);
|
||||
}
|
||||
auto colon = context.ConsumeIf(Lex::TokenKind::Colon);
|
||||
if (identifier && !colon) {
|
||||
CARBON_DIAGNOSTIC(ExpectedFieldColon, Error,
|
||||
"expected `:` in field declaration");
|
||||
context.emitter().Emit(*context.position(), ExpectedFieldColon);
|
||||
}
|
||||
if (!identifier || !colon) {
|
||||
context.AddNode(NodeKind::FieldDecl,
|
||||
context.SkipPastLikelyEnd(*(context.position() - 1)),
|
||||
/*has_error=*/true);
|
||||
state.has_error = true;
|
||||
return;
|
||||
}
|
||||
context.PushState(state, StateKind::VarFinishAsField);
|
||||
context.AddLeafNode(NodeKind::IdentifierNameNotBeforeSignature, *identifier);
|
||||
state.token = *colon;
|
||||
context.PushState(state, StateKind::VarAfterPatternAsField);
|
||||
context.PushState(StateKind::Expr);
|
||||
}
|
||||
|
||||
static auto HandleVarAfterPattern(Context& context, NodeKind pattern_kind,
|
||||
NodeKind init_kind) -> void {
|
||||
auto HandleVarAfterPattern(Context& context) -> void {
|
||||
auto state = context.PopState();
|
||||
|
||||
if (state.has_error) {
|
||||
@@ -92,26 +62,16 @@ static auto HandleVarAfterPattern(Context& context, NodeKind pattern_kind,
|
||||
}
|
||||
}
|
||||
|
||||
context.AddNode(pattern_kind, state.token, state.has_error);
|
||||
context.AddNode(NodeKind::VariablePattern, state.token, state.has_error);
|
||||
|
||||
if (context.PositionIs(Lex::TokenKind::Equal)) {
|
||||
context.AddLeafNode(init_kind,
|
||||
context.AddLeafNode(NodeKind::VariableInitializer,
|
||||
context.ConsumeChecked(Lex::TokenKind::Equal));
|
||||
context.PushState(StateKind::Expr);
|
||||
}
|
||||
}
|
||||
|
||||
auto HandleVarAfterPatternAsVar(Context& context) -> void {
|
||||
HandleVarAfterPattern(context, NodeKind::VariablePattern,
|
||||
NodeKind::VariableInitializer);
|
||||
}
|
||||
|
||||
auto HandleVarAfterPatternAsField(Context& context) -> void {
|
||||
HandleVarAfterPattern(context, NodeKind::FieldNameAndType,
|
||||
NodeKind::FieldInitializer);
|
||||
}
|
||||
|
||||
static auto HandleVarFinish(Context& context, NodeKind node_kind) -> void {
|
||||
auto HandleVarFinish(Context& context) -> void {
|
||||
auto state = context.PopState();
|
||||
|
||||
auto end_token = state.token;
|
||||
@@ -123,15 +83,7 @@ static auto HandleVarFinish(Context& context, NodeKind node_kind) -> void {
|
||||
state.has_error = true;
|
||||
end_token = context.SkipPastLikelyEnd(state.token);
|
||||
}
|
||||
context.AddNode(node_kind, end_token, state.has_error);
|
||||
}
|
||||
|
||||
auto HandleVarFinishAsRegular(Context& context) -> void {
|
||||
HandleVarFinish(context, NodeKind::VariableDecl);
|
||||
}
|
||||
|
||||
auto HandleVarFinishAsField(Context& context) -> void {
|
||||
HandleVarFinish(context, NodeKind::FieldDecl);
|
||||
context.AddNode(NodeKind::VariableDecl, end_token, state.has_error);
|
||||
}
|
||||
|
||||
auto HandleVariablePattern(Context& context) -> void {
|
||||
|
||||
@@ -202,11 +202,6 @@ CARBON_PARSE_NODE_KIND(VariableInitializer)
|
||||
CARBON_PARSE_NODE_KIND(VariableDecl)
|
||||
CARBON_PARSE_NODE_KIND(VariablePattern)
|
||||
|
||||
CARBON_PARSE_NODE_KIND(FieldIntroducer)
|
||||
CARBON_PARSE_NODE_KIND(FieldInitializer)
|
||||
CARBON_PARSE_NODE_KIND(FieldDecl)
|
||||
CARBON_PARSE_NODE_KIND(FieldNameAndType)
|
||||
|
||||
CARBON_PARSE_NODE_KIND(ExprStatement)
|
||||
|
||||
CARBON_PARSE_NODE_KIND(BreakStatementStart)
|
||||
|
||||
@@ -408,10 +408,6 @@ CARBON_PARSE_STATE(DeclNameAndParamsAfterParams)
|
||||
// ^~~
|
||||
// 1. VarAsRegular
|
||||
//
|
||||
// var ... (variant is Class)
|
||||
// ^~~
|
||||
// 1. FieldDecl
|
||||
//
|
||||
// ;
|
||||
// ^
|
||||
// (state done)
|
||||
@@ -1630,14 +1626,14 @@ CARBON_PARSE_STATE(ObserveDecl)
|
||||
// var ... (variant is Regular)
|
||||
// ^
|
||||
// 1. Pattern
|
||||
// 2. VarAfterPatternAsVar
|
||||
// 3. VarFinishAsRegular
|
||||
// 2. VarAfterPattern
|
||||
// 3. VarFinish
|
||||
//
|
||||
// returned var ... (variant is Returned)
|
||||
// ^~~~~~~~~~~~
|
||||
// 1. Pattern
|
||||
// 2. VarAfterPatternAsVar
|
||||
// 3. VarFinishAsRegular
|
||||
// 2. VarAfterPattern
|
||||
// 3. VarFinish
|
||||
//
|
||||
// returned ??? ; (variant is Returned)
|
||||
// ^~~~~~~~~~~~~~
|
||||
@@ -1656,7 +1652,7 @@ CARBON_PARSE_STATE_VARIANTS2(Var, Regular, Returned)
|
||||
// var ... ...
|
||||
// ^
|
||||
// (state done)
|
||||
CARBON_PARSE_STATE_VARIANTS2(VarAfterPattern, Var, Field)
|
||||
CARBON_PARSE_STATE(VarAfterPattern)
|
||||
|
||||
// Handles `var` parsing at the end.
|
||||
//
|
||||
@@ -1665,22 +1661,7 @@ CARBON_PARSE_STATE_VARIANTS2(VarAfterPattern, Var, Field)
|
||||
// var ... ??? ;
|
||||
// ^~~~~
|
||||
// (state done)
|
||||
CARBON_PARSE_STATE_VARIANTS2(VarFinish, Regular, Field)
|
||||
|
||||
// Handles the beginning of a field declaration (`var` in a class context).
|
||||
//
|
||||
// var name : type
|
||||
// ^~~~~~
|
||||
// 1. Expr
|
||||
// 2. VarAfterPatternAsField
|
||||
// 3. VarFinishAsField
|
||||
//
|
||||
// var ??? ;
|
||||
// ^~~~~
|
||||
// var name ??? ;
|
||||
// ^~~~~~~~~
|
||||
// (state done)
|
||||
CARBON_PARSE_STATE(FieldDecl)
|
||||
CARBON_PARSE_STATE(VarFinish)
|
||||
|
||||
// Handles the start of a `let`.
|
||||
//
|
||||
|
||||
+56
-41
@@ -9,25 +9,21 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/class/fail_var_name.carbon
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:6: error: expected identifier in field declaration [ExpectedFieldIdentifier]
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:6: error: expected pattern [ExpectedPattern]
|
||||
// CHECK:STDERR: var;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var;
|
||||
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:11: error: expected `:` in field declaration [ExpectedFieldColon]
|
||||
// CHECK:STDERR: var name;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var name;
|
||||
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:7: error: expected identifier in field declaration [ExpectedFieldIdentifier]
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:7: error: expected pattern [ExpectedPattern]
|
||||
// CHECK:STDERR: var :;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var :;
|
||||
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:7: error: expected identifier in field declaration [ExpectedFieldIdentifier]
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:7: error: expected pattern [ExpectedPattern]
|
||||
// CHECK:STDERR: var : C;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -39,7 +35,7 @@ class C {
|
||||
// CHECK:STDERR:
|
||||
var name:;
|
||||
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:12: error: expected `:` in field declaration [ExpectedFieldColon]
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:12: error: `var` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR: var name C;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -51,21 +47,17 @@ class C {
|
||||
// CHECK:STDERR:
|
||||
var name: C C;
|
||||
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:7: error: expected identifier in field declaration [ExpectedFieldIdentifier]
|
||||
// CHECK:STDERR: var self: C;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
var self: C;
|
||||
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:12: error: expected `:` in field declaration [ExpectedFieldColon]
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:12: error: `var` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR: var name name: C;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
var name name: C;
|
||||
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:11: error: expected `:` in field declaration [ExpectedFieldColon]
|
||||
// CHECK:STDERR: fail_var_name.carbon:[[@LINE+4]]:15: error: found `:!` pattern inside `var` pattern [NonRegularBindingInVarDecl]
|
||||
// CHECK:STDERR: var name:! C;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var name:! C;
|
||||
}
|
||||
@@ -76,32 +68,55 @@ class C {
|
||||
// CHECK:STDOUT: {kind: 'ClassIntroducer', text: 'class'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'C'},
|
||||
// CHECK:STDOUT: {kind: 'ClassDefinitionStart', text: '{', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'FieldIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'FieldDecl', text: ';', has_error: yes, subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'FieldIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'FieldDecl', text: ';', has_error: yes, subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'FieldIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'FieldDecl', text: ';', has_error: yes, subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'FieldIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'FieldDecl', text: ';', has_error: yes, subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'FieldIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'name'},
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'FieldNameAndType', text: ':', has_error: yes, subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'FieldDecl', text: ';', subtree_size: 5},
|
||||
// CHECK:STDOUT: {kind: 'FieldIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'FieldDecl', text: ';', has_error: yes, subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'FieldIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'name'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'C'},
|
||||
// CHECK:STDOUT: {kind: 'FieldNameAndType', text: ':', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'FieldDecl', text: ';', has_error: yes, subtree_size: 5},
|
||||
// CHECK:STDOUT: {kind: 'FieldIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'FieldDecl', text: ';', has_error: yes, subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'FieldIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'FieldDecl', text: ';', has_error: yes, subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'FieldIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'FieldDecl', text: ';', has_error: yes, subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'ClassDefinition', text: '}', subtree_size: 30},
|
||||
// CHECK:STDOUT: {kind: 'VariablePattern', text: 'var', has_error: yes, subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'name'},
|
||||
// CHECK:STDOUT: {kind: 'VariablePattern', text: 'var', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'InvalidParse', text: ':', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'VariablePattern', text: 'var', has_error: yes, subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'InvalidParse', text: ':', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'VariablePattern', text: 'var', has_error: yes, subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'name'},
|
||||
// CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes},
|
||||
// CHECK:STDOUT: {kind: 'VarBindingPattern', text: ':', has_error: yes, subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'VariablePattern', text: 'var', has_error: yes, subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'name'},
|
||||
// CHECK:STDOUT: {kind: 'VariablePattern', text: 'var', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', has_error: yes, subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'name'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'C'},
|
||||
// CHECK:STDOUT: {kind: 'VarBindingPattern', text: ':', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'VariablePattern', text: 'var', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', has_error: yes, subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'SelfValueName', text: 'self'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'C'},
|
||||
// CHECK:STDOUT: {kind: 'VarBindingPattern', text: ':', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'VariablePattern', text: 'var', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'name'},
|
||||
// CHECK:STDOUT: {kind: 'VariablePattern', text: 'var', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', has_error: yes, subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'name'},
|
||||
// CHECK:STDOUT: {kind: 'CompileTimeBindingPatternStart', text: ':!', subtree_size: 2},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'C'},
|
||||
// CHECK:STDOUT: {kind: 'VarBindingPattern', text: ':!', has_error: yes, subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'VariablePattern', text: 'var', has_error: yes, subtree_size: 5},
|
||||
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 7},
|
||||
// CHECK:STDOUT: {kind: 'ClassDefinition', text: '}', subtree_size: 53},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
+14
-12
@@ -20,18 +20,20 @@ class Foo {
|
||||
// CHECK:STDOUT: {kind: 'ClassIntroducer', text: 'class'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'Foo'},
|
||||
// CHECK:STDOUT: {kind: 'ClassDefinitionStart', text: '{', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'FieldIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'IntTypeLiteral', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'FieldNameAndType', text: ':', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'FieldDecl', text: ';', subtree_size: 5},
|
||||
// CHECK:STDOUT: {kind: 'FieldIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'y'},
|
||||
// CHECK:STDOUT: {kind: 'IntTypeLiteral', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'FieldNameAndType', text: ':', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'FieldInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'x'},
|
||||
// CHECK:STDOUT: {kind: 'IntTypeLiteral', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'VarBindingPattern', text: ':', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'VariablePattern', text: 'var', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 6},
|
||||
// CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
|
||||
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeSignature', text: 'y'},
|
||||
// CHECK:STDOUT: {kind: 'IntTypeLiteral', text: 'i32'},
|
||||
// CHECK:STDOUT: {kind: 'VarBindingPattern', text: ':', subtree_size: 3},
|
||||
// CHECK:STDOUT: {kind: 'VariablePattern', text: 'var', subtree_size: 4},
|
||||
// CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
|
||||
// CHECK:STDOUT: {kind: 'IntLiteral', text: '0'},
|
||||
// CHECK:STDOUT: {kind: 'FieldDecl', text: ';', subtree_size: 7},
|
||||
// CHECK:STDOUT: {kind: 'ClassDefinition', text: '}', subtree_size: 16},
|
||||
// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8},
|
||||
// CHECK:STDOUT: {kind: 'ClassDefinition', text: '}', subtree_size: 18},
|
||||
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
@@ -604,6 +604,11 @@ struct LetDecl {
|
||||
};
|
||||
|
||||
// Associated constant nodes
|
||||
//
|
||||
// TODO: remove these nodes and parse associated constants as regular
|
||||
// `let`s instead. This will make associated constant parsing mirror how
|
||||
// class vars are handled; see
|
||||
// https://github.com/carbon-language/carbon-lang/pull/7188.
|
||||
using AssociatedConstantIntroducer =
|
||||
LeafNode<NodeKind::AssociatedConstantIntroducer, Lex::LetTokenIndex>;
|
||||
using AssociatedConstantInitializer =
|
||||
@@ -666,35 +671,6 @@ struct VariableDecl {
|
||||
Lex::SemiTokenIndex token;
|
||||
};
|
||||
|
||||
using FieldIntroducer = LeafNode<NodeKind::FieldIntroducer, Lex::VarTokenIndex>;
|
||||
using FieldInitializer =
|
||||
LeafNode<NodeKind::FieldInitializer, Lex::EqualTokenIndex>;
|
||||
|
||||
struct FieldNameAndType {
|
||||
static constexpr auto Kind =
|
||||
NodeKind::FieldNameAndType.Define({.child_count = 2});
|
||||
|
||||
IdentifierNameNotBeforeSignatureId name;
|
||||
Lex::ColonTokenIndex token;
|
||||
AnyExprId type;
|
||||
};
|
||||
|
||||
struct FieldDecl {
|
||||
static constexpr auto Kind = NodeKind::FieldDecl.Define(
|
||||
{.category = NodeCategory::Decl, .bracketed_by = FieldIntroducer::Kind});
|
||||
|
||||
FieldIntroducerId introducer;
|
||||
llvm::SmallVector<AnyModifierId> modifiers;
|
||||
FieldNameAndTypeId name_and_type;
|
||||
|
||||
struct Initializer {
|
||||
FieldInitializerId equals;
|
||||
AnyExprId value;
|
||||
};
|
||||
std::optional<Initializer> initializer;
|
||||
Lex::SemiTokenIndex token;
|
||||
};
|
||||
|
||||
// A `var` pattern.
|
||||
struct VariablePattern {
|
||||
static constexpr auto Kind = NodeKind::VariablePattern.Define(
|
||||
|
||||
@@ -717,11 +717,10 @@ struct FacetValue {
|
||||
// A field in a class, of the form `var field: field_type;`. The type of the
|
||||
// `FieldDecl` instruction is an `UnboundElementType`.
|
||||
struct FieldDecl {
|
||||
static constexpr auto Kind =
|
||||
InstKind::FieldDecl.Define<Parse::FieldNameAndTypeId>(
|
||||
{.ir_name = "field_decl",
|
||||
.expr_category = ExprCategory::NotExpr,
|
||||
.constant_kind = InstConstantKind::AlwaysUnique});
|
||||
static constexpr auto Kind = InstKind::FieldDecl.Define<Parse::NodeId>(
|
||||
{.ir_name = "field_decl",
|
||||
.expr_category = ExprCategory::NotExpr,
|
||||
.constant_kind = InstConstantKind::AlwaysUnique});
|
||||
|
||||
TypeId type_id;
|
||||
NameId name_id;
|
||||
|
||||
Reference in New Issue
Block a user