mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 09:34:42 +01:00
Reduce use of the prelude in tests (#5683)
Remove use of i32/bool when a builtin type or test-define class type can work. Make `Sub` user-defines in a test that is testing builtin functions and not trying to test the prelude, in the same way that it defines its own Negate. Reduce use of the + operator when it isn't contributing to the test's coverage, since the + operator needs the full prelude. Remove use of Core.Print when it's not required for the test. Move `deduce_nested_facet_value.carbon` to its own file since it uses TypeAnd, and the rest of deduce.carbon does not, but uses i32. This means they can each use a different min-prelude. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
fd0f62f980
commit
19d59b2a8d
@@ -2,9 +2,6 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/fail_convert_to_invalid.carbon
|
||||
@@ -20,63 +17,5 @@ class C {
|
||||
}
|
||||
|
||||
fn Make() -> C {
|
||||
return {.a = 123};
|
||||
return {.a = ()};
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- fail_convert_to_invalid.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
|
||||
// CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete]
|
||||
// CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: Core.IntLiteral} [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: .NoSuchType = <poisoned>
|
||||
// CHECK:STDOUT: .Make = %Make.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [concrete = constants.%Make] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %return.param: ref %C = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %C = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %NoSuchType.ref: <error> = name_ref NoSuchType, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc19: <error> = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: <error>} [concrete = <error>]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.a [concrete = <error>]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: .NoSuchType = <poisoned>
|
||||
// CHECK:STDOUT: .a = %.loc19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Make() -> %return.param: %C {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123]
|
||||
// CHECK:STDOUT: %.loc23: %struct_type.a = struct_literal (%int_123)
|
||||
// CHECK:STDOUT: return <error> to %return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+11
-157
@@ -2,15 +2,14 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/fail_generic_method.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_generic_method.carbon
|
||||
|
||||
class I {}
|
||||
|
||||
class Class(T:! type) {
|
||||
var a: T;
|
||||
fn F[self: Self](n: T);
|
||||
@@ -18,164 +17,19 @@ class Class(T:! type) {
|
||||
|
||||
// TODO: The follow-on errors here aren't great. Investigate whether we can
|
||||
// enter the scope anyway if the parameters don't match.
|
||||
// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+15]]:10: error: type `<pattern for i32>` of parameter 1 in redeclaration differs from previous parameter type `<pattern for type>` [RedeclParamDiffersType]
|
||||
// CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {}
|
||||
// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+15]]:10: error: type `<pattern for I>` of parameter 1 in redeclaration differs from previous parameter type `<pattern for type>` [RedeclParamDiffersType]
|
||||
// CHECK:STDERR: fn Class(N:! I).F[self: Self](n: T) {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_generic_method.carbon:[[@LINE-10]]:13: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR: class Class(T:! type) {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+8]]:27: error: name `Self` not found [NameNotFound]
|
||||
// CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {}
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+8]]:25: error: name `Self` not found [NameNotFound]
|
||||
// CHECK:STDERR: fn Class(N:! I).F[self: Self](n: T) {}
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+4]]:36: error: name `T` not found [NameNotFound]
|
||||
// CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+4]]:34: error: name `T` not found [NameNotFound]
|
||||
// CHECK:STDERR: fn Class(N:! I).F[self: Self](n: T) {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
fn Class(N:! i32).F[self: Self](n: T) {}
|
||||
|
||||
// CHECK:STDOUT: --- fail_generic_method.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
|
||||
// CHECK:STDOUT: %Class.type: type = generic_class_type @Class [concrete]
|
||||
// CHECK:STDOUT: %Class.generic: %Class.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic]
|
||||
// CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
|
||||
// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.3c1: type = pattern_type %Class [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
|
||||
// CHECK:STDOUT: %F.type.6d6: type = fn_type @F.1, @Class(%T) [symbolic]
|
||||
// CHECK:STDOUT: %F.cca: %F.type.6d6 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T} [symbolic]
|
||||
// CHECK:STDOUT: %complete_type.f1b: <witness> = complete_type_witness %struct_type.a [symbolic]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// 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: %N.51e: %i32 = bind_symbolic_name N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %F.type.b25: type = fn_type @F.2 [concrete]
|
||||
// CHECK:STDOUT: %F.c41: %F.type.b25 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .Class = %Class.decl
|
||||
// CHECK:STDOUT: .T = <poisoned>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [concrete = constants.%Class.generic] {
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.loc14_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_13.2 (constants.%T)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl: %F.type.b25 = fn_decl @F.2 [concrete = constants.%F.c41] {
|
||||
// CHECK:STDOUT: %self.patt: <error> = binding_pattern self [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt: <error> = value_param_pattern %self.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %n.patt: <error> = binding_pattern n [concrete]
|
||||
// CHECK:STDOUT: %n.param_patt: <error> = value_param_pattern %n.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc36: type = splice_block %i32 [concrete = constants.%i32] {
|
||||
// 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: }
|
||||
// CHECK:STDOUT: %N.loc36_10.1: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc36_10.2 (constants.%N.51e)]
|
||||
// CHECK:STDOUT: %self.param: <error> = value_param call_param0
|
||||
// CHECK:STDOUT: %Self.ref: <error> = name_ref Self, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %self: <error> = bind_name self, %self.param [concrete = <error>]
|
||||
// CHECK:STDOUT: %n.param: <error> = value_param call_param1
|
||||
// CHECK:STDOUT: %T.ref: <error> = name_ref T, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %n: <error> = bind_name n, %n.param [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @Class(%T.loc14_13.1: type) {
|
||||
// CHECK:STDOUT: %T.loc14_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_13.2 (constants.%T)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc14_13.2 [symbolic = %require_complete (constants.%require_complete.4ae)]
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.loc14_13.2) [symbolic = %Class (constants.%Class)]
|
||||
// CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %T.loc14_13.2 [symbolic = %Class.elem (constants.%Class.elem)]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F.1, @Class(%T.loc14_13.2) [symbolic = %F.type (constants.%F.type.6d6)]
|
||||
// CHECK:STDOUT: %F: @Class.%F.type (%F.type.6d6) = struct_value () [symbolic = %F (constants.%F.cca)]
|
||||
// CHECK:STDOUT: %struct_type.a.loc17_1.2: type = struct_type {.a: @Class.%T.loc14_13.2 (%T)} [symbolic = %struct_type.a.loc17_1.2 (constants.%struct_type.a)]
|
||||
// CHECK:STDOUT: %complete_type.loc17_1.2: <witness> = complete_type_witness %struct_type.a.loc17_1.2 [symbolic = %complete_type.loc17_1.2 (constants.%complete_type.f1b)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc14_13.1 [symbolic = %T.loc14_13.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc15: @Class.%Class.elem (%Class.elem) = field_decl a, element0 [concrete]
|
||||
// CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type.6d6) = fn_decl @F.1 [symbolic = @Class.%F (constants.%F.cca)] {
|
||||
// CHECK:STDOUT: %self.patt: @F.1.%pattern_type.loc16_8 (%pattern_type.3c1) = binding_pattern self [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type.loc16_8 (%pattern_type.3c1) = value_param_pattern %self.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %n.patt: @F.1.%pattern_type.loc16_20 (%pattern_type.7dc) = binding_pattern n [concrete]
|
||||
// CHECK:STDOUT: %n.param_patt: @F.1.%pattern_type.loc16_20 (%pattern_type.7dc) = value_param_pattern %n.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: @F.1.%Class (%Class) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc16_14.1: type = splice_block %Self.ref [symbolic = %Class (constants.%Class)] {
|
||||
// CHECK:STDOUT: %.loc16_14.2: type = specific_constant constants.%Class, @Class(constants.%T) [symbolic = %Class (constants.%Class)]
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, %.loc16_14.2 [symbolic = %Class (constants.%Class)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %self: @F.1.%Class (%Class) = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %n.param: @F.1.%T (%T) = value_param call_param1
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, @Class.%T.loc14_13.1 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %n: @F.1.%T (%T) = bind_name n, %n.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %struct_type.a.loc17_1.1: type = struct_type {.a: %T} [symbolic = %struct_type.a.loc17_1.2 (constants.%struct_type.a)]
|
||||
// CHECK:STDOUT: %complete_type.loc17_1.1: <witness> = complete_type_witness %struct_type.a.loc17_1.1 [symbolic = %complete_type.loc17_1.2 (constants.%complete_type.f1b)]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type.loc17_1.1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%Class
|
||||
// CHECK:STDOUT: .T = <poisoned>
|
||||
// CHECK:STDOUT: .a = %.loc15
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F.1(@Class.%T.loc14_13.1: type) {
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class)]
|
||||
// CHECK:STDOUT: %pattern_type.loc16_8: type = pattern_type %Class [symbolic = %pattern_type.loc16_8 (constants.%pattern_type.3c1)]
|
||||
// CHECK:STDOUT: %pattern_type.loc16_20: type = pattern_type %T [symbolic = %pattern_type.loc16_20 (constants.%pattern_type.7dc)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%self.param: @F.1.%Class (%Class), %n.param: @F.1.%T (%T));
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F.2(%N.loc36_10.1: %i32) {
|
||||
// CHECK:STDOUT: %N.loc36_10.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc36_10.2 (constants.%N.51e)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%self.param: <error>, %n.param: <error>) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Class(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc14_13.2 => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F.1(constants.%T) {
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT: %Class => constants.%Class
|
||||
// CHECK:STDOUT: %pattern_type.loc16_8 => constants.%pattern_type.3c1
|
||||
// CHECK:STDOUT: %pattern_type.loc16_20 => constants.%pattern_type.7dc
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F.2(constants.%N.51e) {
|
||||
// CHECK:STDOUT: %N.loc36_10.2 => constants.%N.51e
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
fn Class(N:! I).F[self: Self](n: T) {}
|
||||
|
||||
+2
-348
@@ -2,9 +2,6 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/fail_incomplete.carbon
|
||||
@@ -55,7 +52,7 @@ var global_var: Class;
|
||||
// CHECK:STDERR:
|
||||
fn ConvertFromStruct() -> Class { return {}; }
|
||||
|
||||
fn G(p: Class*) -> i32 {
|
||||
fn G(p: Class*) -> () {
|
||||
// CHECK:STDERR: fail_forward_decl.carbon:[[@LINE+7]]:10: error: member access into object of incomplete type `Class` [IncompleteTypeInMemberAccess]
|
||||
// CHECK:STDERR: return p->n;
|
||||
// CHECK:STDERR: ^~~~
|
||||
@@ -66,7 +63,7 @@ fn G(p: Class*) -> i32 {
|
||||
return p->n;
|
||||
}
|
||||
|
||||
fn MemberAccess(p: Class*) -> i32 {
|
||||
fn MemberAccess(p: Class*) -> () {
|
||||
// CHECK:STDERR: fail_forward_decl.carbon:[[@LINE+7]]:11: error: member access into object of incomplete type `Class` [IncompleteTypeInMemberAccess]
|
||||
// CHECK:STDERR: return (*p).n;
|
||||
// CHECK:STDERR: ^~
|
||||
@@ -176,346 +173,3 @@ class C {
|
||||
// CHECK:STDERR:
|
||||
var c: C;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- fail_forward_decl.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class [concrete]
|
||||
// CHECK:STDOUT: %Function.type: type = fn_type @Function [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %Function: %Function.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %CallClassFunction.type: type = fn_type @CallClassFunction [concrete]
|
||||
// CHECK:STDOUT: %CallClassFunction: %CallClassFunction.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.761: type = pattern_type %Class [concrete]
|
||||
// CHECK:STDOUT: %ConvertFromStruct.type: type = fn_type @ConvertFromStruct [concrete]
|
||||
// CHECK:STDOUT: %ConvertFromStruct: %ConvertFromStruct.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %ptr.e71: type = ptr_type %Class [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.796: type = pattern_type %ptr.e71 [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// 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: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %MemberAccess.type: type = fn_type @MemberAccess [concrete]
|
||||
// CHECK:STDOUT: %MemberAccess: %MemberAccess.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Copy.type: type = fn_type @Copy [concrete]
|
||||
// CHECK:STDOUT: %Copy: %Copy.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Let.type: type = fn_type @Let [concrete]
|
||||
// CHECK:STDOUT: %Let: %Let.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %TakeIncomplete.type: type = fn_type @TakeIncomplete [concrete]
|
||||
// CHECK:STDOUT: %TakeIncomplete: %TakeIncomplete.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ReturnIncomplete.type: type = fn_type @ReturnIncomplete [concrete]
|
||||
// CHECK:STDOUT: %ReturnIncomplete: %ReturnIncomplete.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %CallTakeIncomplete.type: type = fn_type @CallTakeIncomplete [concrete]
|
||||
// CHECK:STDOUT: %CallTakeIncomplete: %CallTakeIncomplete.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %CallReturnIncomplete.type: type = fn_type @CallReturnIncomplete [concrete]
|
||||
// CHECK:STDOUT: %CallReturnIncomplete: %CallReturnIncomplete.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %IncompleteAddrSelf: type = class_type @IncompleteAddrSelf [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %CallIncompleteAddrSelf.type: type = fn_type @CallIncompleteAddrSelf [concrete]
|
||||
// CHECK:STDOUT: %CallIncompleteAddrSelf: %CallIncompleteAddrSelf.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .Class = %Class.decl
|
||||
// CHECK:STDOUT: .CallClassFunction = %CallClassFunction.decl
|
||||
// CHECK:STDOUT: .global_var = %global_var
|
||||
// CHECK:STDOUT: .ConvertFromStruct = %ConvertFromStruct.decl
|
||||
// CHECK:STDOUT: .G = %G.decl
|
||||
// CHECK:STDOUT: .MemberAccess = %MemberAccess.decl
|
||||
// CHECK:STDOUT: .Copy = %Copy.decl
|
||||
// CHECK:STDOUT: .Let = %Let.decl
|
||||
// CHECK:STDOUT: .TakeIncomplete = %TakeIncomplete.decl
|
||||
// CHECK:STDOUT: .ReturnIncomplete = %ReturnIncomplete.decl
|
||||
// CHECK:STDOUT: .CallTakeIncomplete = %CallTakeIncomplete.decl
|
||||
// CHECK:STDOUT: .CallReturnIncomplete = %CallReturnIncomplete.decl
|
||||
// CHECK:STDOUT: .IncompleteAddrSelf = %IncompleteAddrSelf.decl
|
||||
// CHECK:STDOUT: .CallIncompleteAddrSelf = %CallIncompleteAddrSelf.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Class.decl: type = class_decl @Class [concrete = constants.%Class] {} {}
|
||||
// CHECK:STDOUT: %Function.decl: %Function.type = fn_decl @Function [concrete = constants.%Function] {} {}
|
||||
// CHECK:STDOUT: %CallClassFunction.decl: %CallClassFunction.type = fn_decl @CallClassFunction [concrete = constants.%CallClassFunction] {} {}
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %global_var.patt: <error> = binding_pattern global_var [concrete]
|
||||
// CHECK:STDOUT: %global_var.var_patt: <error> = var_pattern %global_var.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %global_var.var: ref <error> = var %global_var.var_patt [concrete = <error>]
|
||||
// CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: %global_var: <error> = bind_name global_var, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %ConvertFromStruct.decl: %ConvertFromStruct.type = fn_decl @ConvertFromStruct [concrete = constants.%ConvertFromStruct] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.761 = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.761 = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: %return.param: ref %Class = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %Class = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
|
||||
// CHECK:STDOUT: %p.patt: %pattern_type.796 = binding_pattern p [concrete]
|
||||
// CHECK:STDOUT: %p.param_patt: %pattern_type.796 = value_param_pattern %p.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// 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: %p.param: %ptr.e71 = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc44: type = splice_block %ptr [concrete = constants.%ptr.e71] {
|
||||
// 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.e71]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p: %ptr.e71 = bind_name p, %p.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %MemberAccess.decl: %MemberAccess.type = fn_decl @MemberAccess [concrete = constants.%MemberAccess] {
|
||||
// CHECK:STDOUT: %p.patt: %pattern_type.796 = binding_pattern p [concrete]
|
||||
// CHECK:STDOUT: %p.param_patt: %pattern_type.796 = value_param_pattern %p.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// 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: %p.param: %ptr.e71 = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc55: type = splice_block %ptr [concrete = constants.%ptr.e71] {
|
||||
// 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.e71]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p: %ptr.e71 = bind_name p, %p.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Copy.decl: %Copy.type = fn_decl @Copy [concrete = constants.%Copy] {
|
||||
// CHECK:STDOUT: %p.patt: %pattern_type.796 = binding_pattern p [concrete]
|
||||
// CHECK:STDOUT: %p.param_patt: %pattern_type.796 = value_param_pattern %p.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.761 = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.761 = out_param_pattern %return.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Class.ref.loc73_23: type = name_ref Class, file.%Class.decl [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: %p.param: %ptr.e71 = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc73: type = splice_block %ptr [concrete = constants.%ptr.e71] {
|
||||
// CHECK:STDOUT: %Class.ref.loc73_12: type = name_ref Class, file.%Class.decl [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Class.ref.loc73_12 [concrete = constants.%ptr.e71]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p: %ptr.e71 = bind_name p, %p.param
|
||||
// CHECK:STDOUT: %return.param: ref %Class = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %Class = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Let.decl: %Let.type = fn_decl @Let [concrete = constants.%Let] {
|
||||
// CHECK:STDOUT: %p.patt: %pattern_type.796 = binding_pattern p [concrete]
|
||||
// CHECK:STDOUT: %p.param_patt: %pattern_type.796 = value_param_pattern %p.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %p.param: %ptr.e71 = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc77: type = splice_block %ptr [concrete = constants.%ptr.e71] {
|
||||
// CHECK:STDOUT: %Class.ref.loc77: type = name_ref Class, file.%Class.decl [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Class.ref.loc77 [concrete = constants.%ptr.e71]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p: %ptr.e71 = bind_name p, %p.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %TakeIncomplete.decl: %TakeIncomplete.type = fn_decl @TakeIncomplete [concrete = constants.%TakeIncomplete] {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.761 = binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %c.param_patt: %pattern_type.761 = value_param_pattern %c.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %c.param: %Class = value_param call_param0
|
||||
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: %c: %Class = bind_name c, %c.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %ReturnIncomplete.decl: %ReturnIncomplete.type = fn_decl @ReturnIncomplete [concrete = constants.%ReturnIncomplete] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.761 = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.761 = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: %return.param: ref %Class = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %Class = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %CallTakeIncomplete.decl: %CallTakeIncomplete.type = fn_decl @CallTakeIncomplete [concrete = constants.%CallTakeIncomplete] {
|
||||
// CHECK:STDOUT: %p.patt: %pattern_type.796 = binding_pattern p [concrete]
|
||||
// CHECK:STDOUT: %p.param_patt: %pattern_type.796 = value_param_pattern %p.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %p.param: %ptr.e71 = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc92: type = splice_block %ptr [concrete = constants.%ptr.e71] {
|
||||
// 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.e71]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p: %ptr.e71 = bind_name p, %p.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %CallReturnIncomplete.decl: %CallReturnIncomplete.type = fn_decl @CallReturnIncomplete [concrete = constants.%CallReturnIncomplete] {} {}
|
||||
// CHECK:STDOUT: %IncompleteAddrSelf.decl: type = class_decl @IncompleteAddrSelf [concrete = constants.%IncompleteAddrSelf] {} {}
|
||||
// CHECK:STDOUT: %CallIncompleteAddrSelf.decl: %CallIncompleteAddrSelf.type = fn_decl @CallIncompleteAddrSelf [concrete = constants.%CallIncompleteAddrSelf] {
|
||||
// CHECK:STDOUT: %p.patt: %pattern_type.796 = binding_pattern p [concrete]
|
||||
// CHECK:STDOUT: %p.param_patt: %pattern_type.796 = value_param_pattern %p.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %p.param: %ptr.e71 = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc136: type = splice_block %ptr [concrete = constants.%ptr.e71] {
|
||||
// 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.e71]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p: %ptr.e71 = bind_name p, %p.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Class;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @IncompleteAddrSelf {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.796 = binding_pattern self [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.796 = value_param_pattern %self.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %.loc133_8: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: %ptr.e71 = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc133_24: type = splice_block %ptr [concrete = constants.%ptr.e71] {
|
||||
// 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.e71]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %self: %ptr.e71 = bind_name self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%IncompleteAddrSelf
|
||||
// CHECK:STDOUT: .Class = <poisoned>
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Function() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @CallClassFunction() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: %Function.ref: <error> = name_ref Function, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @ConvertFromStruct() -> %Class {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc42: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G(%p.param: %ptr.e71) -> %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %p.ref: %ptr.e71 = name_ref p, %p
|
||||
// CHECK:STDOUT: %.loc52: ref %Class = deref %p.ref
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @MemberAccess(%p.param: %ptr.e71) -> %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %p.ref: %ptr.e71 = name_ref p, %p
|
||||
// CHECK:STDOUT: %.loc63: ref %Class = deref %p.ref
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Copy(%p.param: %ptr.e71) -> %Class {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %p.ref: %ptr.e71 = name_ref p, %p
|
||||
// CHECK:STDOUT: %.loc74: ref %Class = deref %p.ref
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Let(%p.param: %ptr.e71) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: <error> = binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p.ref: %ptr.e71 = name_ref p, %p
|
||||
// CHECK:STDOUT: %.loc85: ref %Class = deref %p.ref
|
||||
// CHECK:STDOUT: %Class.ref.loc85: type = name_ref Class, file.%Class.decl [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: %c: <error> = bind_name c, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @TakeIncomplete(%c.param: %Class);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @ReturnIncomplete() -> %Class;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @CallTakeIncomplete(%p.param: %ptr.e71) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %TakeIncomplete.ref.loc103: %TakeIncomplete.type = name_ref TakeIncomplete, file.%TakeIncomplete.decl [concrete = constants.%TakeIncomplete]
|
||||
// CHECK:STDOUT: %p.ref: %ptr.e71 = name_ref p, %p
|
||||
// CHECK:STDOUT: %.loc103: ref %Class = deref %p.ref
|
||||
// CHECK:STDOUT: %TakeIncomplete.call.loc103: init %empty_tuple.type = call %TakeIncomplete.ref.loc103(<error>)
|
||||
// CHECK:STDOUT: %TakeIncomplete.ref.loc115: %TakeIncomplete.type = name_ref TakeIncomplete, file.%TakeIncomplete.decl [concrete = constants.%TakeIncomplete]
|
||||
// CHECK:STDOUT: %.loc115: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %TakeIncomplete.call.loc115: init %empty_tuple.type = call %TakeIncomplete.ref.loc115(<error>)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @CallReturnIncomplete() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %ReturnIncomplete.ref: %ReturnIncomplete.type = name_ref ReturnIncomplete, file.%ReturnIncomplete.decl [concrete = constants.%ReturnIncomplete]
|
||||
// CHECK:STDOUT: %ReturnIncomplete.call: init <error> = call %ReturnIncomplete.ref()
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%self.param: %ptr.e71);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @CallIncompleteAddrSelf(%p.param: %ptr.e71) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %p.ref: %ptr.e71 = name_ref p, %p
|
||||
// CHECK:STDOUT: %IncompleteAddrSelf.ref: type = name_ref IncompleteAddrSelf, file.%IncompleteAddrSelf.decl [concrete = constants.%IncompleteAddrSelf]
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, @IncompleteAddrSelf.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %.loc148: ref %Class = deref %p.ref
|
||||
// CHECK:STDOUT: %F.bound: <bound method> = bound_method %.loc148, %F.ref
|
||||
// CHECK:STDOUT: %addr: <error> = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.bound(<error>)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_in_definition.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [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: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %.loc12: <error> = field_decl c, element0 [concrete]
|
||||
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: <error>} [concrete = <error>]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.c [concrete = <error>]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: .C = <poisoned>
|
||||
// CHECK:STDOUT: .c = %.loc12
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+1
-79
@@ -2,9 +2,6 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/fail_member_of_let.carbon
|
||||
@@ -12,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_member_of_let.carbon
|
||||
|
||||
class Class {
|
||||
fn F() -> i32;
|
||||
fn F() -> ();
|
||||
}
|
||||
|
||||
// TODO: Use `:!` here once it is available.
|
||||
@@ -28,78 +25,3 @@ let T: type = Class;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
fn T.F() {}
|
||||
|
||||
// CHECK:STDOUT: --- fail_member_of_let.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// 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: %F.type.f1b: type = fn_type @F.1 [concrete]
|
||||
// CHECK:STDOUT: %F.1f2: %F.type.f1b = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
|
||||
// CHECK:STDOUT: %F.type.b25: type = fn_type @F.2 [concrete]
|
||||
// CHECK:STDOUT: %F.c41: %F.type.b25 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .Class = %Class.decl
|
||||
// CHECK:STDOUT: .T = %T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Class.decl: type = class_decl @Class [concrete = constants.%Class] {} {}
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.98f = binding_pattern T [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T: type = bind_name T, @__global_init.%Class.ref
|
||||
// CHECK:STDOUT: %F.decl: %F.type.b25 = fn_decl @F.2 [concrete = constants.%F.c41] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Class {
|
||||
// CHECK:STDOUT: %F.decl: %F.type.f1b = fn_decl @F.1 [concrete = constants.%F.1f2] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// 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: %return.param: ref %i32 = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%Class
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F.1() -> %i32;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F.2() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+3
-112
@@ -2,9 +2,6 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/fail_scope.carbon
|
||||
@@ -12,121 +9,15 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_scope.carbon
|
||||
|
||||
class Class {
|
||||
fn F() -> i32 {
|
||||
return 1;
|
||||
fn F() -> () {
|
||||
return ();
|
||||
}
|
||||
}
|
||||
|
||||
fn G() -> i32 {
|
||||
fn G() -> () {
|
||||
// CHECK:STDERR: fail_scope.carbon:[[@LINE+4]]:10: error: name `F` not found [NameNotFound]
|
||||
// CHECK:STDERR: return F();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
return F();
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- fail_scope.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// 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: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
||||
// 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.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.3, @impl.4f9(%To.c80) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.3, @impl.4f9(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet.921: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
|
||||
// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet.921 [concrete]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1.5b8, %Convert.956 [concrete]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.3(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .Class = %Class.decl
|
||||
// CHECK:STDOUT: .G = %G.decl
|
||||
// CHECK:STDOUT: .F = <poisoned>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Class.decl: type = class_decl @Class [concrete = constants.%Class] {} {}
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// 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: %return.param: ref %i32 = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Class {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// 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: %return.param: ref %i32 = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%Class
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() -> %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %bound_method.loc16_13.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.3(constants.%int_32) [concrete = constants.%Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc16_13.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc16_13.2(%int_1) [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc16_13.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc16_13.2: %i32 = converted %int_1, %.loc16_13.1 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: return %.loc16_13.2
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() -> %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: <error> = name_ref F, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+1
-62
@@ -2,9 +2,6 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/fail_self_param.carbon
|
||||
@@ -16,62 +13,4 @@
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
class C[self:! type](x:! self) {}
|
||||
var v: C(0);
|
||||
|
||||
// CHECK:STDOUT: --- fail_self_param.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C.type: type = generic_class_type @C [concrete]
|
||||
// CHECK:STDOUT: %C.generic: %C.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: %int_0: Core.IntLiteral = int_value 0 [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: .v = %v
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
|
||||
// CHECK:STDOUT: %x.patt: <error> = symbolic_binding_pattern x, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.ref: <error> = name_ref self, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %x: <error> = bind_symbolic_name x, 0 [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: <error> = binding_pattern v [concrete]
|
||||
// CHECK:STDOUT: %v.var_patt: <error> = var_pattern %v.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref <error> = var %v.var_patt [concrete = <error>]
|
||||
// CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: <error> = bind_name v, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @C(%x: <error>) {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @C(<error>) {}
|
||||
// CHECK:STDOUT:
|
||||
var v: C(());
|
||||
|
||||
+119
-104
@@ -38,13 +38,15 @@ class A(T:! type) {}
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class B(N:! i32);
|
||||
class A {}
|
||||
|
||||
class B(N:! A);
|
||||
// CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE+7]]:1: error: redeclaration differs because of implicit parameter list [RedeclParamListDiffers]
|
||||
// CHECK:STDERR: class B[T:! type](N:! T) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE-4]]:1: note: previously declared without implicit parameter list [RedeclParamListPrevious]
|
||||
// CHECK:STDERR: class B(N:! i32);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: class B(N:! A);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
class B[T:! type](N:! T) {}
|
||||
|
||||
@@ -52,29 +54,33 @@ class B[T:! type](N:! T) {}
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class A {}
|
||||
|
||||
class C(T:! type);
|
||||
// CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 2 [RedeclParamCountDiffers]
|
||||
// CHECK:STDERR: class C(T:! type, U:! i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: class C(T:! type, U:! A) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 1 [RedeclParamCountPrevious]
|
||||
// CHECK:STDERR: class C(T:! type);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
class C(T:! type, U:! i32) {}
|
||||
class C(T:! type, U:! A) {}
|
||||
|
||||
// --- fail_mismatch_param_type.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class A {}
|
||||
|
||||
class D(T:! type);
|
||||
// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE+7]]:9: error: type `<pattern for i32>` of parameter 1 in redeclaration differs from previous parameter type `<pattern for type>` [RedeclParamDiffersType]
|
||||
// CHECK:STDERR: class D(T:! i32) {}
|
||||
// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE+7]]:9: error: type `<pattern for A>` of parameter 1 in redeclaration differs from previous parameter type `<pattern for type>` [RedeclParamDiffersType]
|
||||
// CHECK:STDERR: class D(T:! A) {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE-4]]:9: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR: class D(T:! type);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
class D(T:! i32) {}
|
||||
class D(T:! A) {}
|
||||
|
||||
// --- fail_mismatch_param_name.carbon
|
||||
|
||||
@@ -204,12 +210,11 @@ class E(U:! type) {}
|
||||
// CHECK:STDOUT: --- fail_mismatch_implicit_param_list.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// 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: %N.51e: %i32 = bind_symbolic_name N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %A: type = class_type @A [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %N.9e6: %A = bind_symbolic_name N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
|
||||
// CHECK:STDOUT: %B.type.844c0f.1: type = generic_class_type @B.1 [concrete]
|
||||
// CHECK:STDOUT: %B.generic.ba299b.1: %B.type.844c0f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
|
||||
@@ -219,60 +224,64 @@ class E(U:! type) {}
|
||||
// CHECK:STDOUT: %B.type.844c0f.2: type = generic_class_type @B.2 [concrete]
|
||||
// CHECK:STDOUT: %B.generic.ba299b.2: %B.type.844c0f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %B.828: type = class_type @B.2, @B.2(%T, %N.f22) [symbolic]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .B = %B.decl.loc4
|
||||
// CHECK:STDOUT: .A = %A.decl
|
||||
// CHECK:STDOUT: .B = %B.decl.loc6
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %B.decl.loc4: %B.type.844c0f.1 = class_decl @B.1 [concrete = constants.%B.generic.ba299b.1] {
|
||||
// CHECK:STDOUT: %N.patt: %pattern_type.7ce = symbolic_binding_pattern N, 0 [concrete]
|
||||
// CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: %B.decl.loc6: %B.type.844c0f.1 = class_decl @B.1 [concrete = constants.%B.generic.ba299b.1] {
|
||||
// CHECK:STDOUT: %N.patt: %pattern_type.c10 = symbolic_binding_pattern N, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc4: type = splice_block %i32 [concrete = constants.%i32] {
|
||||
// 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: }
|
||||
// CHECK:STDOUT: %N.loc4_9.1: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.51e)]
|
||||
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %N.loc6_9.1: %A = bind_symbolic_name N, 0 [symbolic = %N.loc6_9.2 (constants.%N.9e6)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %B.decl.loc12: %B.type.844c0f.2 = class_decl @B.2 [concrete = constants.%B.generic.ba299b.2] {
|
||||
// CHECK:STDOUT: %B.decl.loc14: %B.type.844c0f.2 = class_decl @B.2 [concrete = constants.%B.generic.ba299b.2] {
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
|
||||
// CHECK:STDOUT: %N.patt: @B.2.%pattern_type (%pattern_type.7dc) = symbolic_binding_pattern N, 1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc12_9.1 [symbolic = %T.loc12_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %N.loc12_19.1: @B.2.%T.loc12_9.2 (%T) = bind_symbolic_name N, 1 [symbolic = %N.loc12_19.2 (constants.%N.f22)]
|
||||
// CHECK:STDOUT: %T.loc14_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc14_9.1 [symbolic = %T.loc14_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %N.loc14_19.1: @B.2.%T.loc14_9.2 (%T) = bind_symbolic_name N, 1 [symbolic = %N.loc14_19.2 (constants.%N.f22)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @B.1(%N.loc4_9.1: %i32) {
|
||||
// CHECK:STDOUT: %N.loc4_9.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc4_9.2 (constants.%N.51e)]
|
||||
// CHECK:STDOUT: class @A {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%A
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @B.1(%N.loc6_9.1: %A) {
|
||||
// CHECK:STDOUT: %N.loc6_9.2: %A = bind_symbolic_name N, 0 [symbolic = %N.loc6_9.2 (constants.%N.9e6)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @B.2(%T.loc12_9.1: type, %N.loc12_19.1: @B.2.%T.loc12_9.2 (%T)) {
|
||||
// CHECK:STDOUT: %T.loc12_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %N.loc12_19.2: @B.2.%T.loc12_9.2 (%T) = bind_symbolic_name N, 1 [symbolic = %N.loc12_19.2 (constants.%N.f22)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc12_9.2 [symbolic = %pattern_type (constants.%pattern_type.7dc)]
|
||||
// CHECK:STDOUT: generic class @B.2(%T.loc14_9.1: type, %N.loc14_19.1: @B.2.%T.loc14_9.2 (%T)) {
|
||||
// CHECK:STDOUT: %T.loc14_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %N.loc14_19.2: @B.2.%T.loc14_9.2 (%T) = bind_symbolic_name N, 1 [symbolic = %N.loc14_19.2 (constants.%N.f22)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc14_9.2 [symbolic = %pattern_type (constants.%pattern_type.7dc)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
|
||||
// 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:
|
||||
@@ -280,178 +289,184 @@ class E(U:! type) {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @B.1(constants.%N.51e) {
|
||||
// CHECK:STDOUT: %N.loc4_9.2 => constants.%N.51e
|
||||
// CHECK:STDOUT: specific @B.1(constants.%N.9e6) {
|
||||
// CHECK:STDOUT: %N.loc6_9.2 => constants.%N.9e6
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @B.2(constants.%T, constants.%N.f22) {
|
||||
// CHECK:STDOUT: %T.loc12_9.2 => constants.%T
|
||||
// CHECK:STDOUT: %N.loc12_19.2 => constants.%N.f22
|
||||
// CHECK:STDOUT: %T.loc14_9.2 => constants.%T
|
||||
// CHECK:STDOUT: %N.loc14_19.2 => constants.%N.f22
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_mismatch_param_count.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %A: type = class_type @A [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
|
||||
// CHECK:STDOUT: %C.type.e6e560.1: type = generic_class_type @C.1 [concrete]
|
||||
// CHECK:STDOUT: %C.generic.965b12.1: %C.type.e6e560.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// 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: %U: %i32 = bind_symbolic_name U, 1 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %U: %A = bind_symbolic_name U, 1 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
|
||||
// CHECK:STDOUT: %C.type.e6e560.2: type = generic_class_type @C.2 [concrete]
|
||||
// CHECK:STDOUT: %C.generic.965b12.2: %C.type.e6e560.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.9d5: type = class_type @C.2, @C.2(%T, %U) [symbolic]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %C.3d8: type = class_type @C.2, @C.2(%T, %U) [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .C = %C.decl.loc4
|
||||
// CHECK:STDOUT: .A = %A.decl
|
||||
// CHECK:STDOUT: .C = %C.decl.loc6
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %C.decl.loc4: %C.type.e6e560.1 = class_decl @C.1 [concrete = constants.%C.generic.965b12.1] {
|
||||
// CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: %C.decl.loc6: %C.type.e6e560.1 = class_decl @C.1 [concrete = constants.%C.generic.965b12.1] {
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.loc6_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %C.decl.loc12: %C.type.e6e560.2 = class_decl @C.2 [concrete = constants.%C.generic.965b12.2] {
|
||||
// CHECK:STDOUT: %C.decl.loc14: %C.type.e6e560.2 = class_decl @C.2 [concrete = constants.%C.generic.965b12.2] {
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
|
||||
// CHECK:STDOUT: %U.patt: %pattern_type.7ce = symbolic_binding_pattern U, 1 [concrete]
|
||||
// CHECK:STDOUT: %U.patt: %pattern_type.c10 = symbolic_binding_pattern U, 1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.loc12_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc12: type = splice_block %i32 [concrete = constants.%i32] {
|
||||
// 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: }
|
||||
// CHECK:STDOUT: %U.loc12_19.1: %i32 = bind_symbolic_name U, 1 [symbolic = %U.loc12_19.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %T.loc14_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %U.loc14_19.1: %A = bind_symbolic_name U, 1 [symbolic = %U.loc14_19.2 (constants.%U)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @C.1(%T.loc4_9.1: type) {
|
||||
// CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT: class @A {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%A
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @C.1(%T.loc6_9.1: type) {
|
||||
// CHECK:STDOUT: %T.loc6_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @C.2(%T.loc12_9.1: type, %U.loc12_19.1: %i32) {
|
||||
// CHECK:STDOUT: %T.loc12_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %U.loc12_19.2: %i32 = bind_symbolic_name U, 1 [symbolic = %U.loc12_19.2 (constants.%U)]
|
||||
// CHECK:STDOUT: generic class @C.2(%T.loc14_9.1: type, %U.loc14_19.1: %A) {
|
||||
// CHECK:STDOUT: %T.loc14_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc14_9.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %U.loc14_19.2: %A = bind_symbolic_name U, 1 [symbolic = %U.loc14_19.2 (constants.%U)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
|
||||
// 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.9d5
|
||||
// CHECK:STDOUT: .Self = constants.%C.3d8
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @C.1(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc4_9.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.loc6_9.2 => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @C.2(constants.%T, constants.%U) {
|
||||
// CHECK:STDOUT: %T.loc12_9.2 => constants.%T
|
||||
// CHECK:STDOUT: %U.loc12_19.2 => constants.%U
|
||||
// CHECK:STDOUT: %T.loc14_9.2 => constants.%T
|
||||
// CHECK:STDOUT: %U.loc14_19.2 => constants.%U
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_mismatch_param_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %A: type = class_type @A [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
|
||||
// CHECK:STDOUT: %D.type.bbd080.1: type = generic_class_type @D.1 [concrete]
|
||||
// CHECK:STDOUT: %D.generic.4e2319.1: %D.type.bbd080.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// 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: %T.51e: %i32 = bind_symbolic_name T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %T.9e6: %A = bind_symbolic_name T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.c10: type = pattern_type %A [concrete]
|
||||
// CHECK:STDOUT: %D.type.bbd080.2: type = generic_class_type @D.2 [concrete]
|
||||
// CHECK:STDOUT: %D.generic.4e2319.2: %D.type.bbd080.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %D.022: type = class_type @D.2, @D.2(%T.51e) [symbolic]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %D.384: type = class_type @D.2, @D.2(%T.9e6) [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .D = %D.decl.loc4
|
||||
// CHECK:STDOUT: .A = %A.decl
|
||||
// CHECK:STDOUT: .D = %D.decl.loc6
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %D.decl.loc4: %D.type.bbd080.1 = class_decl @D.1 [concrete = constants.%D.generic.4e2319.1] {
|
||||
// CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: %D.decl.loc6: %D.type.bbd080.1 = class_decl @D.1 [concrete = constants.%D.generic.4e2319.1] {
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %T.loc6_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %D.decl.loc12: %D.type.bbd080.2 = class_decl @D.2 [concrete = constants.%D.generic.4e2319.2] {
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.7ce = symbolic_binding_pattern T, 0 [concrete]
|
||||
// CHECK:STDOUT: %D.decl.loc14: %D.type.bbd080.2 = class_decl @D.2 [concrete = constants.%D.generic.4e2319.2] {
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.c10 = symbolic_binding_pattern T, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc12: type = splice_block %i32 [concrete = constants.%i32] {
|
||||
// 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: }
|
||||
// CHECK:STDOUT: %T.loc12_9.1: %i32 = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T.51e)]
|
||||
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %T.loc14_9.1: %A = bind_symbolic_name T, 0 [symbolic = %T.loc14_9.2 (constants.%T.9e6)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @D.1(%T.loc4_9.1: type) {
|
||||
// CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: class @A {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%A
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @D.1(%T.loc6_9.1: type) {
|
||||
// CHECK:STDOUT: %T.loc6_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_9.2 (constants.%T.8b3)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @D.2(%T.loc12_9.1: %i32) {
|
||||
// CHECK:STDOUT: %T.loc12_9.2: %i32 = bind_symbolic_name T, 0 [symbolic = %T.loc12_9.2 (constants.%T.51e)]
|
||||
// CHECK:STDOUT: generic class @D.2(%T.loc14_9.1: %A) {
|
||||
// CHECK:STDOUT: %T.loc14_9.2: %A = bind_symbolic_name T, 0 [symbolic = %T.loc14_9.2 (constants.%T.9e6)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
|
||||
// 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.%D.022
|
||||
// CHECK:STDOUT: .Self = constants.%D.384
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @D.1(constants.%T.8b3) {
|
||||
// CHECK:STDOUT: %T.loc4_9.2 => constants.%T.8b3
|
||||
// CHECK:STDOUT: %T.loc6_9.2 => constants.%T.8b3
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @D.2(constants.%T.51e) {
|
||||
// CHECK:STDOUT: %T.loc12_9.2 => constants.%T.51e
|
||||
// CHECK:STDOUT: specific @D.2(constants.%T.9e6) {
|
||||
// CHECK:STDOUT: %T.loc14_9.2 => constants.%T.9e6
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_mismatch_param_name.carbon
|
||||
|
||||
+19
-24
@@ -14,19 +14,18 @@
|
||||
class Class;
|
||||
|
||||
class Class {
|
||||
fn F[self: Self](b: bool);
|
||||
fn F[self: Self](b: ());
|
||||
}
|
||||
|
||||
fn Class.F[self: Self](b: bool) {}
|
||||
fn Class.F[self: Self](b: ()) {}
|
||||
|
||||
// CHECK:STDOUT: --- redeclaration.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.761: type = pattern_type %Class [concrete]
|
||||
// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
|
||||
// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
@@ -35,11 +34,9 @@ fn Class.F[self: Self](b: bool) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Bool = %Core.Bool
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -53,19 +50,18 @@ fn Class.F[self: Self](b: bool) {}
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.761 = binding_pattern self [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.761 = value_param_pattern %self.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.831 = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern %b.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.cb1 = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.param_patt: %pattern_type.cb1 = value_param_pattern %b.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param.loc20: %Class = value_param call_param0
|
||||
// CHECK:STDOUT: %Self.ref.loc20: type = name_ref Self, constants.%Class [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: %self.loc20: %Class = bind_name self, %self.param.loc20
|
||||
// CHECK:STDOUT: %b.param.loc20: bool = value_param call_param1
|
||||
// CHECK:STDOUT: %.loc20_27.1: type = splice_block %.loc20_27.3 [concrete = bool] {
|
||||
// CHECK:STDOUT: %bool.make_type.loc20: init type = call constants.%Bool() [concrete = bool]
|
||||
// CHECK:STDOUT: %.loc20_27.2: type = value_of_initializer %bool.make_type.loc20 [concrete = bool]
|
||||
// CHECK:STDOUT: %.loc20_27.3: type = converted %bool.make_type.loc20, %.loc20_27.2 [concrete = bool]
|
||||
// CHECK:STDOUT: %b.param.loc20: %empty_tuple.type = value_param call_param1
|
||||
// CHECK:STDOUT: %.loc20_28.1: type = splice_block %.loc20_28.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc20_28.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc20_28.3: type = converted %.loc20_28.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.loc20: bool = bind_name b, %b.param.loc20
|
||||
// CHECK:STDOUT: %b.loc20: %empty_tuple.type = bind_name b, %b.param.loc20
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -73,19 +69,18 @@ fn Class.F[self: Self](b: bool) {}
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.761 = binding_pattern self [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.761 = value_param_pattern %self.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.831 = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern %b.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.cb1 = binding_pattern b [concrete]
|
||||
// CHECK:STDOUT: %b.param_patt: %pattern_type.cb1 = value_param_pattern %b.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param.loc17: %Class = value_param call_param0
|
||||
// CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [concrete = constants.%Class]
|
||||
// CHECK:STDOUT: %self.loc17: %Class = bind_name self, %self.param.loc17
|
||||
// CHECK:STDOUT: %b.param.loc17: bool = value_param call_param1
|
||||
// CHECK:STDOUT: %.loc17_23.1: type = splice_block %.loc17_23.3 [concrete = bool] {
|
||||
// CHECK:STDOUT: %bool.make_type.loc17: init type = call constants.%Bool() [concrete = bool]
|
||||
// CHECK:STDOUT: %.loc17_23.2: type = value_of_initializer %bool.make_type.loc17 [concrete = bool]
|
||||
// CHECK:STDOUT: %.loc17_23.3: type = converted %bool.make_type.loc17, %.loc17_23.2 [concrete = bool]
|
||||
// CHECK:STDOUT: %b.param.loc17: %empty_tuple.type = value_param call_param1
|
||||
// CHECK:STDOUT: %.loc17_24.1: type = splice_block %.loc17_24.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc17_24.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc17_24.3: type = converted %.loc17_24.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.loc17: bool = bind_name b, %b.param.loc17
|
||||
// CHECK:STDOUT: %b.loc17: %empty_tuple.type = bind_name b, %b.param.loc17
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
||||
@@ -96,7 +91,7 @@ fn Class.F[self: Self](b: bool) {}
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%self.param.loc20: %Class, %b.param.loc20: bool) {
|
||||
// CHECK:STDOUT: fn @F(%self.param.loc20: %Class, %b.param.loc20: %empty_tuple.type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
Reference in New Issue
Block a user