|
|
@@ -8,161 +8,430 @@
|
|
|
// TIP: To dump output, run:
|
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/destroy.carbon
|
|
|
|
|
|
-// --- fail_todo_basic.carbon
|
|
|
+// --- self.carbon
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
class C {
|
|
|
- // CHECK:STDERR: fail_todo_basic.carbon:[[@LINE+4]]:6: error: semantics TODO: `KeywordNameBeforeParamsId` [SemanticsTodo]
|
|
|
- // CHECK:STDERR: fn destroy[self: Self]();
|
|
|
- // CHECK:STDERR: ^~~~~~~
|
|
|
- // CHECK:STDERR:
|
|
|
fn destroy[self: Self]();
|
|
|
}
|
|
|
|
|
|
-// --- fail_todo_addr.carbon
|
|
|
+// --- addr_self.carbon
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
class C {
|
|
|
- // CHECK:STDERR: fail_todo_addr.carbon:[[@LINE+4]]:6: error: semantics TODO: `KeywordNameBeforeParamsId` [SemanticsTodo]
|
|
|
- // CHECK:STDERR: fn destroy[addr self: Self*]();
|
|
|
- // CHECK:STDERR: ^~~~~~~
|
|
|
- // CHECK:STDERR:
|
|
|
fn destroy[addr self: Self*]();
|
|
|
}
|
|
|
|
|
|
-// --- fail_todo_class_function.carbon
|
|
|
+// --- explicit_return.carbon
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
class C {
|
|
|
- // CHECK:STDERR: fail_todo_class_function.carbon:[[@LINE+4]]:6: error: semantics TODO: `KeywordNameBeforeParamsId` [SemanticsTodo]
|
|
|
+ fn destroy[self: Self]() -> ();
|
|
|
+}
|
|
|
+
|
|
|
+// --- fail_class_function.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
+class C {
|
|
|
+ // CHECK:STDERR: fail_class_function.carbon:[[@LINE+4]]:3: error: missing implicit `self` parameter [DestroyFunctionMissingSelf]
|
|
|
// CHECK:STDERR: fn destroy();
|
|
|
- // CHECK:STDERR: ^~~~~~~
|
|
|
+ // CHECK:STDERR: ^~~~~~~~~~~~~
|
|
|
// CHECK:STDERR:
|
|
|
fn destroy();
|
|
|
}
|
|
|
|
|
|
-// --- fail_todo_destroy_in_namespace.carbon
|
|
|
+// --- fail_extra_implicit_params_second.carbon
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
-namespace NS;
|
|
|
+class C {
|
|
|
+ // CHECK:STDERR: fail_extra_implicit_params_second.carbon:[[@LINE+4]]:26: error: unexpected implicit parameter [DestroyFunctionUnexpectedImplicitParam]
|
|
|
+ // CHECK:STDERR: fn destroy[self: Self, T:! type]();
|
|
|
+ // CHECK:STDERR: ^
|
|
|
+ // CHECK:STDERR:
|
|
|
+ fn destroy[self: Self, T:! type]();
|
|
|
+}
|
|
|
|
|
|
-// CHECK:STDERR: fail_todo_destroy_in_namespace.carbon:[[@LINE+4]]:7: error: semantics TODO: `KeywordNameBeforeParamsId` [SemanticsTodo]
|
|
|
-// CHECK:STDERR: fn NS.destroy();
|
|
|
-// CHECK:STDERR: ^~~~~~~
|
|
|
-// CHECK:STDERR:
|
|
|
-fn NS.destroy();
|
|
|
+// --- fail_extra_implicit_params_first.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
+class C {
|
|
|
+ // CHECK:STDERR: fail_extra_implicit_params_first.carbon:[[@LINE+4]]:14: error: unexpected implicit parameter [DestroyFunctionUnexpectedImplicitParam]
|
|
|
+ // CHECK:STDERR: fn destroy[T:! type, self: Self]();
|
|
|
+ // CHECK:STDERR: ^
|
|
|
+ // CHECK:STDERR:
|
|
|
+ fn destroy[T:! type, self: Self]();
|
|
|
+}
|
|
|
+
|
|
|
+// --- fail_positional_params.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
+class C {
|
|
|
+ // CHECK:STDERR: fail_positional_params.carbon:[[@LINE+8]]:25: error: a `(` for parameters is required after implicit parameters [ParamsRequiredAfterImplicit]
|
|
|
+ // CHECK:STDERR: fn destroy[self: Self];
|
|
|
+ // CHECK:STDERR: ^
|
|
|
+ // CHECK:STDERR:
|
|
|
+ // CHECK:STDERR: fail_positional_params.carbon:[[@LINE+4]]:3: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
|
|
+ // CHECK:STDERR: fn destroy[self: Self];
|
|
|
+ // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
|
|
+ // CHECK:STDERR:
|
|
|
+ fn destroy[self: Self];
|
|
|
+}
|
|
|
|
|
|
-// --- fail_todo_missing_params.carbon
|
|
|
+// --- fail_explicit_params.carbon
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
+class C {
|
|
|
+ // CHECK:STDERR: fail_explicit_params.carbon:[[@LINE+4]]:26: error: unexpected parameter [DestroyFunctionNonEmptyExplicitParams]
|
|
|
+ // CHECK:STDERR: fn destroy[self: Self](x: ());
|
|
|
+ // CHECK:STDERR: ^~~~~
|
|
|
+ // CHECK:STDERR:
|
|
|
+ fn destroy[self: Self](x: ());
|
|
|
+}
|
|
|
+
|
|
|
+// --- fail_return_type.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
|
|
|
class C {
|
|
|
- // CHECK:STDERR: fail_todo_missing_params.carbon:[[@LINE+4]]:6: error: semantics TODO: `KeywordNameNotBeforeParamsId` [SemanticsTodo]
|
|
|
- // CHECK:STDERR: fn destroy;
|
|
|
- // CHECK:STDERR: ^~~~~~~
|
|
|
+ // CHECK:STDERR: fail_return_type.carbon:[[@LINE+4]]:28: error: incorrect return type; must be unspecified or `()` [DestroyFunctionIncorrectReturnType]
|
|
|
+ // CHECK:STDERR: fn destroy[self: Self]() -> {};
|
|
|
+ // CHECK:STDERR: ^~~~~
|
|
|
// CHECK:STDERR:
|
|
|
- fn destroy;
|
|
|
+ fn destroy[self: Self]() -> {};
|
|
|
+}
|
|
|
+
|
|
|
+// --- fail_out_of_line_missing_params.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
+
|
|
|
+class C {
|
|
|
+ fn destroy[self: Self]();
|
|
|
}
|
|
|
|
|
|
+// CHECK:STDERR: fail_out_of_line_missing_params.carbon:[[@LINE+7]]:1: error: redeclaration differs because of missing implicit parameter list [RedeclParamListDiffers]
|
|
|
+// CHECK:STDERR: fn C.destroy {}
|
|
|
+// CHECK:STDERR: ^~~~~~~~~~~~~~
|
|
|
+// CHECK:STDERR: fail_out_of_line_missing_params.carbon:[[@LINE-6]]:3: note: previously declared with implicit parameter list [RedeclParamListPrevious]
|
|
|
+// CHECK:STDERR: fn destroy[self: Self]();
|
|
|
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
+// CHECK:STDERR:
|
|
|
fn C.destroy {}
|
|
|
|
|
|
-// --- fail_todo_wrong_scope.carbon
|
|
|
+// --- fail_destroy_in_file_scope.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
+// CHECK:STDERR: fail_destroy_in_file_scope.carbon:[[@LINE+4]]:1: error: declaring `fn destroy` in non-class scope [DestroyFunctionOutsideClass]
|
|
|
+// CHECK:STDERR: fn destroy[self: ()]();
|
|
|
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
|
|
+// CHECK:STDERR:
|
|
|
+fn destroy[self: ()]();
|
|
|
+
|
|
|
+// --- fail_destroy_in_namespace_scope.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
+namespace NS;
|
|
|
+
|
|
|
+// CHECK:STDERR: fail_destroy_in_namespace_scope.carbon:[[@LINE+4]]:1: error: declaring `fn destroy` in non-class scope [DestroyFunctionOutsideClass]
|
|
|
+// CHECK:STDERR: fn NS.destroy();
|
|
|
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
|
|
+// CHECK:STDERR:
|
|
|
+fn NS.destroy();
|
|
|
+
|
|
|
+// --- fail_invalid_qualifier_with_params.carbon
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
+class C {
|
|
|
+ fn destroy[self: Self]();
|
|
|
+}
|
|
|
|
|
|
-// CHECK:STDERR: fail_todo_wrong_scope.carbon:[[@LINE+4]]:4: error: semantics TODO: `KeywordNameBeforeParamsId` [SemanticsTodo]
|
|
|
-// CHECK:STDERR: fn destroy();
|
|
|
-// CHECK:STDERR: ^~~~~~~
|
|
|
+// CHECK:STDERR: fail_invalid_qualifier_with_params.carbon:[[@LINE+7]]:6: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope]
|
|
|
+// CHECK:STDERR: fn C.destroy[self: Self]().Foo() {}
|
|
|
+// CHECK:STDERR: ^~~~~~~
|
|
|
+// CHECK:STDERR: fail_invalid_qualifier_with_params.carbon:[[@LINE-6]]:3: note: referenced non-scope entity declared here [QualifiedNameNonScopeEntity]
|
|
|
+// CHECK:STDERR: fn destroy[self: Self]();
|
|
|
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
// CHECK:STDERR:
|
|
|
-fn destroy();
|
|
|
+fn C.destroy[self: Self]().Foo() {}
|
|
|
+
|
|
|
+// --- fail_invalid_qualifier_no_params.carbon
|
|
|
|
|
|
-// --- fail_invalid_qualifier.carbon
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
|
|
|
class C {
|
|
|
- // CHECK:STDERR: fail_invalid_qualifier.carbon:[[@LINE+4]]:6: error: semantics TODO: `KeywordNameBeforeParamsId` [SemanticsTodo]
|
|
|
- // CHECK:STDERR: fn destroy();
|
|
|
- // CHECK:STDERR: ^~~~~~~
|
|
|
- // CHECK:STDERR:
|
|
|
- fn destroy();
|
|
|
+ fn destroy[self: Self]();
|
|
|
}
|
|
|
|
|
|
-fn C.destroy.destroy() {}
|
|
|
+// CHECK:STDERR: fail_invalid_qualifier_no_params.carbon:[[@LINE+7]]:6: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope]
|
|
|
+// CHECK:STDERR: fn C.destroy.Foo() {}
|
|
|
+// CHECK:STDERR: ^~~~~~~
|
|
|
+// CHECK:STDERR: fail_invalid_qualifier_no_params.carbon:[[@LINE-6]]:3: note: referenced non-scope entity declared here [QualifiedNameNonScopeEntity]
|
|
|
+// CHECK:STDERR: fn destroy[self: Self]();
|
|
|
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
+// CHECK:STDERR:
|
|
|
+fn C.destroy.Foo() {}
|
|
|
|
|
|
-// CHECK:STDOUT: --- fail_todo_basic.carbon
|
|
|
+// CHECK:STDOUT: --- self.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
+// CHECK:STDOUT: %destroy.type: type = fn_type @destroy [concrete]
|
|
|
+// CHECK:STDOUT: %destroy: %destroy.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: file {}
|
|
|
+// CHECK:STDOUT: file {
|
|
|
+// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .C = %C.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// 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: %destroy.decl: %destroy.type = fn_decl @destroy [concrete = constants.%destroy] {
|
|
|
+// CHECK:STDOUT: %self.patt: %C = binding_pattern self
|
|
|
+// CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, call_param0
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
|
+// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %self: %C = bind_name self, %self.param
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
|
|
+// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: !members:
|
|
|
// CHECK:STDOUT: .Self = constants.%C
|
|
|
+// CHECK:STDOUT: .destroy = %destroy.decl
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: --- fail_todo_addr.carbon
|
|
|
+// CHECK:STDOUT: fn @destroy[%self.param_patt: %C]();
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- addr_self.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
+// CHECK:STDOUT: %ptr: type = ptr_type %C [concrete]
|
|
|
+// CHECK:STDOUT: %destroy.type: type = fn_type @destroy [concrete]
|
|
|
+// CHECK:STDOUT: %destroy: %destroy.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: file {}
|
|
|
+// CHECK:STDOUT: file {
|
|
|
+// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .C = %C.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// 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: %destroy.decl: %destroy.type = fn_decl @destroy [concrete = constants.%destroy] {
|
|
|
+// CHECK:STDOUT: %self.patt: %ptr = binding_pattern self
|
|
|
+// CHECK:STDOUT: %self.param_patt: %ptr = value_param_pattern %self.patt, call_param0
|
|
|
+// CHECK:STDOUT: %.loc5_14: auto = addr_pattern %self.param_patt
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: %self.param: %ptr = value_param call_param0
|
|
|
+// CHECK:STDOUT: %.loc5_29: type = splice_block %ptr [concrete = constants.%ptr] {
|
|
|
+// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %ptr: type = ptr_type %C [concrete = constants.%ptr]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %self: %ptr = bind_name self, %self.param
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
|
|
+// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: !members:
|
|
|
// CHECK:STDOUT: .Self = constants.%C
|
|
|
+// CHECK:STDOUT: .destroy = %destroy.decl
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: --- fail_todo_class_function.carbon
|
|
|
+// CHECK:STDOUT: fn @destroy[addr %self.param_patt: %ptr]();
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- explicit_return.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
+// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
+// CHECK:STDOUT: %destroy.type: type = fn_type @destroy [concrete]
|
|
|
+// CHECK:STDOUT: %destroy: %destroy.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: file {}
|
|
|
+// CHECK:STDOUT: file {
|
|
|
+// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .C = %C.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// 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: %destroy.decl: %destroy.type = fn_decl @destroy [concrete = constants.%destroy] {
|
|
|
+// CHECK:STDOUT: %self.patt: %C = binding_pattern self
|
|
|
+// CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, call_param0
|
|
|
+// CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern
|
|
|
+// CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, call_param1
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: %.loc5_32.1: %empty_tuple.type = tuple_literal ()
|
|
|
+// CHECK:STDOUT: %.loc5_32.2: type = converted %.loc5_32.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
|
+// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
|
+// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %self: %C = bind_name self, %self.param
|
|
|
+// CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param1
|
|
|
+// CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
|
|
+// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: !members:
|
|
|
// CHECK:STDOUT: .Self = constants.%C
|
|
|
+// CHECK:STDOUT: .destroy = %destroy.decl
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: --- fail_todo_destroy_in_namespace.carbon
|
|
|
+// CHECK:STDOUT: fn @destroy[%self.param_patt: %C]() -> %empty_tuple.type;
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: file {}
|
|
|
+// CHECK:STDOUT: --- fail_class_function.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
+// CHECK:STDOUT: %destroy.type: type = fn_type @destroy [concrete]
|
|
|
+// CHECK:STDOUT: %destroy: %destroy.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: file {
|
|
|
+// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .C = %C.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: class @C {
|
|
|
+// CHECK:STDOUT: %destroy.decl: %destroy.type = fn_decl @destroy [concrete = constants.%destroy] {} {}
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
|
|
+// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: !members:
|
|
|
+// CHECK:STDOUT: .Self = constants.%C
|
|
|
+// CHECK:STDOUT: .destroy = %destroy.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @destroy();
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: --- fail_todo_missing_params.carbon
|
|
|
+// CHECK:STDOUT: --- fail_extra_implicit_params_second.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
+// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
|
|
|
+// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
|
|
|
+// CHECK:STDOUT: %destroy.type: type = fn_type @destroy [concrete]
|
|
|
+// CHECK:STDOUT: %destroy: %destroy.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: file {}
|
|
|
+// CHECK:STDOUT: file {
|
|
|
+// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .C = %C.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// 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: %destroy.decl: %destroy.type = fn_decl @destroy [concrete = constants.%destroy] {
|
|
|
+// CHECK:STDOUT: %self.patt: %C = binding_pattern self
|
|
|
+// CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, call_param0
|
|
|
+// CHECK:STDOUT: %T.patt.loc9_26.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_26.2 (constants.%T.patt)]
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
|
+// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %self: %C = bind_name self, %self.param
|
|
|
+// CHECK:STDOUT: %T.loc9_26.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc9_26.1 (constants.%T)]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
|
|
+// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: !members:
|
|
|
// CHECK:STDOUT: .Self = constants.%C
|
|
|
+// CHECK:STDOUT: .destroy = %destroy.decl
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: --- fail_todo_wrong_scope.carbon
|
|
|
+// CHECK:STDOUT: generic fn @destroy(%T.loc9_26.2: type) {
|
|
|
+// CHECK:STDOUT: %T.loc9_26.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc9_26.1 (constants.%T)]
|
|
|
+// CHECK:STDOUT: %T.patt.loc9_26.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_26.2 (constants.%T.patt)]
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: file {}
|
|
|
+// CHECK:STDOUT: fn[%self.param_patt: %C, %T.patt.loc9_26.1: type]();
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: specific @destroy(constants.%T) {
|
|
|
+// CHECK:STDOUT: %T.loc9_26.1 => constants.%T
|
|
|
+// CHECK:STDOUT: %T.patt.loc9_26.2 => constants.%T
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- fail_extra_implicit_params_first.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
+// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
|
|
|
+// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
|
|
|
+// CHECK:STDOUT: %destroy.type: type = fn_type @destroy [concrete]
|
|
|
+// CHECK:STDOUT: %destroy: %destroy.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: file {
|
|
|
+// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .C = %C.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: class @C {
|
|
|
+// CHECK:STDOUT: %destroy.decl: %destroy.type = fn_decl @destroy [concrete = constants.%destroy] {
|
|
|
+// CHECK:STDOUT: %T.patt.loc9_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_14.2 (constants.%T.patt)]
|
|
|
+// CHECK:STDOUT: %self.patt: %C = binding_pattern self
|
|
|
+// CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, call_param0
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: %T.loc9_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc9_14.1 (constants.%T)]
|
|
|
+// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
|
+// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %self: %C = bind_name self, %self.param
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
|
|
+// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: !members:
|
|
|
+// CHECK:STDOUT: .Self = constants.%C
|
|
|
+// CHECK:STDOUT: .destroy = %destroy.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: generic fn @destroy(%T.loc9_14.2: type) {
|
|
|
+// CHECK:STDOUT: %T.loc9_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc9_14.1 (constants.%T)]
|
|
|
+// CHECK:STDOUT: %T.patt.loc9_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_14.2 (constants.%T.patt)]
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn[%T.patt.loc9_14.1: type, %self.param_patt: %C]();
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: specific @destroy(constants.%T) {
|
|
|
+// CHECK:STDOUT: %T.loc9_14.1 => constants.%T
|
|
|
+// CHECK:STDOUT: %T.patt.loc9_14.2 => constants.%T
|
|
|
+// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: --- fail_invalid_qualifier.carbon
|
|
|
+// CHECK:STDOUT: --- fail_positional_params.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
@@ -177,3 +446,272 @@ fn C.destroy.destroy() {}
|
|
|
// CHECK:STDOUT: .Self = constants.%C
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- fail_explicit_params.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
+// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
+// CHECK:STDOUT: %destroy.type: type = fn_type @destroy [concrete]
|
|
|
+// CHECK:STDOUT: %destroy: %destroy.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: file {
|
|
|
+// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .C = %C.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: class @C {
|
|
|
+// CHECK:STDOUT: %destroy.decl: %destroy.type = fn_decl @destroy [concrete = constants.%destroy] {
|
|
|
+// CHECK:STDOUT: %self.patt: %C = binding_pattern self
|
|
|
+// CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, call_param0
|
|
|
+// CHECK:STDOUT: %x.patt: %empty_tuple.type = binding_pattern x
|
|
|
+// CHECK:STDOUT: %x.param_patt: %empty_tuple.type = value_param_pattern %x.patt, call_param1
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
|
+// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %self: %C = bind_name self, %self.param
|
|
|
+// CHECK:STDOUT: %x.param: %empty_tuple.type = value_param call_param1
|
|
|
+// CHECK:STDOUT: %.loc9_30.1: type = splice_block %.loc9_30.3 [concrete = constants.%empty_tuple.type] {
|
|
|
+// CHECK:STDOUT: %.loc9_30.2: %empty_tuple.type = tuple_literal ()
|
|
|
+// CHECK:STDOUT: %.loc9_30.3: type = converted %.loc9_30.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %x.param
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
|
|
+// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: !members:
|
|
|
+// CHECK:STDOUT: .Self = constants.%C
|
|
|
+// CHECK:STDOUT: .destroy = %destroy.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @destroy[%self.param_patt: %C]();
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- fail_return_type.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
+// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
|
+// CHECK:STDOUT: %destroy.type: type = fn_type @destroy [concrete]
|
|
|
+// CHECK:STDOUT: %destroy: %destroy.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: file {
|
|
|
+// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .C = %C.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: class @C {
|
|
|
+// CHECK:STDOUT: %destroy.decl: %destroy.type = fn_decl @destroy [concrete = constants.%destroy] {
|
|
|
+// CHECK:STDOUT: %self.patt: %C = binding_pattern self
|
|
|
+// CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, call_param0
|
|
|
+// CHECK:STDOUT: %return.patt: %empty_struct_type = return_slot_pattern
|
|
|
+// CHECK:STDOUT: %return.param_patt: %empty_struct_type = out_param_pattern %return.patt, call_param1
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: %.loc9_32.1: %empty_struct_type = struct_literal ()
|
|
|
+// CHECK:STDOUT: %.loc9_32.2: type = converted %.loc9_32.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
|
|
+// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
|
+// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %self: %C = bind_name self, %self.param
|
|
|
+// CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param1
|
|
|
+// CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
|
|
+// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: !members:
|
|
|
+// CHECK:STDOUT: .Self = constants.%C
|
|
|
+// CHECK:STDOUT: .destroy = %destroy.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @destroy[%self.param_patt: %C]() -> %empty_struct_type;
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- fail_out_of_line_missing_params.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
+// CHECK:STDOUT: %destroy.type.bd30b6.1: type = fn_type @destroy.1 [concrete]
|
|
|
+// CHECK:STDOUT: %destroy.357925.1: %destroy.type.bd30b6.1 = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
|
+// CHECK:STDOUT: %destroy.type.bd30b6.2: type = fn_type @destroy.2 [concrete]
|
|
|
+// CHECK:STDOUT: %destroy.357925.2: %destroy.type.bd30b6.2 = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: file {
|
|
|
+// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .C = %C.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
|
|
+// CHECK:STDOUT: %destroy.decl: %destroy.type.bd30b6.2 = fn_decl @destroy.2 [concrete = constants.%destroy.357925.2] {} {}
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: class @C {
|
|
|
+// CHECK:STDOUT: %destroy.decl: %destroy.type.bd30b6.1 = fn_decl @destroy.1 [concrete = constants.%destroy.357925.1] {
|
|
|
+// CHECK:STDOUT: %self.patt: %C = binding_pattern self
|
|
|
+// CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, call_param0
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
|
+// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %self: %C = bind_name self, %self.param
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
|
|
+// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: !members:
|
|
|
+// CHECK:STDOUT: .Self = constants.%C
|
|
|
+// CHECK:STDOUT: .destroy = %destroy.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @destroy.1[%self.param_patt: %C]();
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @destroy.2() {
|
|
|
+// CHECK:STDOUT: !entry:
|
|
|
+// CHECK:STDOUT: return
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- fail_destroy_in_file_scope.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
+// CHECK:STDOUT: %destroy.type: type = fn_type @destroy [concrete]
|
|
|
+// CHECK:STDOUT: %destroy: %destroy.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: file {
|
|
|
+// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .destroy = %destroy.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %destroy.decl: %destroy.type = fn_decl @destroy [concrete = constants.%destroy] {
|
|
|
+// CHECK:STDOUT: %self.patt: %empty_tuple.type = binding_pattern self
|
|
|
+// CHECK:STDOUT: %self.param_patt: %empty_tuple.type = value_param_pattern %self.patt, call_param0
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0
|
|
|
+// CHECK:STDOUT: %.loc8_19.1: type = splice_block %.loc8_19.3 [concrete = constants.%empty_tuple.type] {
|
|
|
+// CHECK:STDOUT: %.loc8_19.2: %empty_tuple.type = tuple_literal ()
|
|
|
+// CHECK:STDOUT: %.loc8_19.3: type = converted %.loc8_19.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @destroy[%self.param_patt: %empty_tuple.type]();
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- fail_destroy_in_namespace_scope.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %destroy.type: type = fn_type @destroy [concrete]
|
|
|
+// CHECK:STDOUT: %destroy: %destroy.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: file {
|
|
|
+// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .NS = %NS
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %NS: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .destroy = %destroy.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %destroy.decl: %destroy.type = fn_decl @destroy [concrete = constants.%destroy] {} {}
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @destroy();
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- fail_invalid_qualifier_with_params.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
+// CHECK:STDOUT: %destroy.type: type = fn_type @destroy [concrete]
|
|
|
+// CHECK:STDOUT: %destroy: %destroy.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
|
+// CHECK:STDOUT: %Foo.type: type = fn_type @Foo [concrete]
|
|
|
+// CHECK:STDOUT: %Foo: %Foo.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: file {
|
|
|
+// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .C = %C.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
|
|
+// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [concrete = constants.%Foo] {} {
|
|
|
+// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
|
+// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %self: %C = bind_name self, %self.param
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: class @C {
|
|
|
+// CHECK:STDOUT: %destroy.decl: %destroy.type = fn_decl @destroy [concrete = constants.%destroy] {
|
|
|
+// CHECK:STDOUT: %self.patt: %C = binding_pattern self
|
|
|
+// CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, call_param0
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
|
+// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %self: %C = bind_name self, %self.param
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
|
|
+// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: !members:
|
|
|
+// CHECK:STDOUT: .Self = constants.%C
|
|
|
+// CHECK:STDOUT: .destroy = %destroy.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @destroy[%self.param_patt: %C]();
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @Foo() {
|
|
|
+// CHECK:STDOUT: !entry:
|
|
|
+// CHECK:STDOUT: return
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- fail_invalid_qualifier_no_params.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
+// CHECK:STDOUT: %destroy.type: type = fn_type @destroy [concrete]
|
|
|
+// CHECK:STDOUT: %destroy: %destroy.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
|
+// CHECK:STDOUT: %Foo.type: type = fn_type @Foo [concrete]
|
|
|
+// CHECK:STDOUT: %Foo: %Foo.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: file {
|
|
|
+// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
+// CHECK:STDOUT: .C = %C.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
|
|
+// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [concrete = constants.%Foo] {} {}
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: class @C {
|
|
|
+// CHECK:STDOUT: %destroy.decl: %destroy.type = fn_decl @destroy [concrete = constants.%destroy] {
|
|
|
+// CHECK:STDOUT: %self.patt: %C = binding_pattern self
|
|
|
+// CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, call_param0
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: %self.param: %C = value_param call_param0
|
|
|
+// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %self: %C = bind_name self, %self.param
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
|
|
+// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: !members:
|
|
|
+// CHECK:STDOUT: .Self = constants.%C
|
|
|
+// CHECK:STDOUT: .destroy = %destroy.decl
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @destroy[%self.param_patt: %C]();
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @Foo() {
|
|
|
+// CHECK:STDOUT: !entry:
|
|
|
+// CHECK:STDOUT: return
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|