mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
High level, replacing `Id::Invalid` with `Id::None` and `Id::is_valid` with `Id::has_value` for clarity, as discussed [here](https://discord.com/channels/655572317891461132/655578254970716160/1331664574545395794). The `IntId` refactoring is needed together with `AnyIdBase` because it's also used with `ValueStore`. Note, trying to be careful not to rewrite `EnumBase::InvalidIndex`, or `is_valid` in general (e.g., `IdKind::is_valid`). I've tried to sequence commits here: 1. Automatic replacements: - `((?:Id|Index)(?: |::|\(|Base(?:\(|::)))Invalid((?:Index)?\W)` -> `$1None$2` - `<invalid>` -> `<none>` - `InvalidNodeId` -> `NoneNodeId` - `/\*invalid\*/` -> `/*none*/` - `id((?:_|\(\))(?:\.|->))is_valid` -> `id$1has_value` 2. Manual edits: - In `int.h` and `int_test.cpp` - `IntT` has `is_value`, which I'm renaming to `is_embedded_value`. - Manual edits to comments in this file. - `AnyIdBase` and `IdBase` - Declaration of `is_valid` -> `has_value`, `InvalidIndex` -> `NoneIndex`. - In `ids.h` and `ids.cpp` - `is_valid` -> `has_value` - `// An explicitly invalid ID.` -> `// An ID with no value.`; similar for index - Various math on `InvalidIndex` -> `NoneIndex` - Various mentions of "valid" in comments - In `value_store.h`, for `IdT::Invalid`, plus one comment - In `impl.h` and `tokenized_buffer.h`, we had different initialization of `::None` values (versus `ids.h` syntax) that I fixed manually. - Spot checks to compile - Particularly where `is_valid` replacements didn't catch spots due to different naming. 3. Autoupdate tests 4. verbose.carbon (NOAUTOUPDATE) 5. Comment spot checks Note there are probably other mentions of "Invalid" that should be swept up, but I'd like to argue for merging and separating out remaining cleanup since this is so sweeping (and likely to hit merge conflicts from churn). We'll probably have lingering mentions of "invalid" for a bit regardless, just because there are uses of "invalid" in non-Id APIs.
380 lines
21 KiB
Plaintext
380 lines
21 KiB
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon
|
|
|
|
// --- params.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface NotGenericNoParams {}
|
|
interface NotGenericButParams() {}
|
|
interface GenericAndParams(T:! type) {}
|
|
|
|
class C(T:! type) {
|
|
interface GenericNoParams {}
|
|
interface GenericAndParams(U:! type) {}
|
|
}
|
|
|
|
class X {}
|
|
impl X as NotGenericNoParams {}
|
|
impl X as NotGenericButParams() {}
|
|
impl X as GenericAndParams(X) {}
|
|
impl X as C(X).GenericNoParams {}
|
|
impl X as C(X).GenericAndParams(X) {}
|
|
|
|
// --- fail_non_generic_implicit_params.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
// CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:13: error: parameters of generic types must be constant [GenericParamMustBeConstant]
|
|
// CHECK:STDERR: interface A[T: type]() {}
|
|
// CHECK:STDERR: ^~~~~~~
|
|
// CHECK:STDERR:
|
|
interface A[T: type]() {}
|
|
|
|
// --- fail_non_generic_params.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
// CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+4]]:13: error: parameters of generic types must be constant [GenericParamMustBeConstant]
|
|
// CHECK:STDERR: interface A(T: type) {}
|
|
// CHECK:STDERR: ^~~~~~~
|
|
// CHECK:STDERR:
|
|
interface A(T: type) {}
|
|
|
|
// CHECK:STDOUT: --- params.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %NotGenericNoParams.type: type = facet_type <@NotGenericNoParams> [template]
|
|
// CHECK:STDOUT: %Self.238: %NotGenericNoParams.type = bind_symbolic_name Self, 0 [symbolic]
|
|
// CHECK:STDOUT: %NotGenericButParams.type.f26: type = generic_interface_type @NotGenericButParams [template]
|
|
// CHECK:STDOUT: %NotGenericButParams.generic: %NotGenericButParams.type.f26 = struct_value () [template]
|
|
// CHECK:STDOUT: %NotGenericButParams.type.014: type = facet_type <@NotGenericButParams> [template]
|
|
// CHECK:STDOUT: %Self.43b: %NotGenericButParams.type.014 = bind_symbolic_name Self, 0 [symbolic]
|
|
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
|
|
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
|
|
// CHECK:STDOUT: %GenericAndParams.type.cde: type = generic_interface_type @GenericAndParams.1 [template]
|
|
// CHECK:STDOUT: %GenericAndParams.generic.827: %GenericAndParams.type.cde = struct_value () [template]
|
|
// CHECK:STDOUT: %GenericAndParams.type.73e: type = facet_type <@GenericAndParams.1, @GenericAndParams.1(%T)> [symbolic]
|
|
// CHECK:STDOUT: %Self.2f4: %GenericAndParams.type.73e = bind_symbolic_name Self, 1 [symbolic]
|
|
// CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
|
|
// CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
|
|
// CHECK:STDOUT: %C.f2e: type = class_type @C, @C(%T) [symbolic]
|
|
// CHECK:STDOUT: %GenericNoParams.type.f90: type = facet_type <@GenericNoParams> [template]
|
|
// CHECK:STDOUT: %GenericNoParams.type.b79: type = facet_type <@GenericNoParams, @GenericNoParams(%T)> [symbolic]
|
|
// CHECK:STDOUT: %Self.0f6: %GenericNoParams.type.b79 = bind_symbolic_name Self, 1 [symbolic]
|
|
// CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic]
|
|
// CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic]
|
|
// CHECK:STDOUT: %GenericAndParams.type.597: type = generic_interface_type @GenericAndParams.2, @C(%T) [symbolic]
|
|
// CHECK:STDOUT: %GenericAndParams.generic.2ec: %GenericAndParams.type.597 = struct_value () [symbolic]
|
|
// CHECK:STDOUT: %GenericAndParams.type.d96: type = facet_type <@GenericAndParams.2, @GenericAndParams.2(%T, %U)> [symbolic]
|
|
// CHECK:STDOUT: %Self.37a: %GenericAndParams.type.d96 = bind_symbolic_name Self, 2 [symbolic]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
|
|
// CHECK:STDOUT: %X: type = class_type @X [template]
|
|
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness () [template]
|
|
// CHECK:STDOUT: %GenericAndParams.type.4b6: type = facet_type <@GenericAndParams.1, @GenericAndParams.1(%X)> [template]
|
|
// CHECK:STDOUT: %C.fac: type = class_type @C, @C(%X) [template]
|
|
// CHECK:STDOUT: %GenericAndParams.type.425: type = generic_interface_type @GenericAndParams.2, @C(%X) [template]
|
|
// CHECK:STDOUT: %GenericAndParams.generic.b50: %GenericAndParams.type.425 = struct_value () [template]
|
|
// CHECK:STDOUT: %GenericAndParams.type.79c: type = facet_type <@GenericAndParams.2, @GenericAndParams.2(%X, %X)> [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .NotGenericNoParams = %NotGenericNoParams.decl
|
|
// CHECK:STDOUT: .NotGenericButParams = %NotGenericButParams.decl
|
|
// CHECK:STDOUT: .GenericAndParams = %GenericAndParams.decl
|
|
// CHECK:STDOUT: .C = %C.decl
|
|
// CHECK:STDOUT: .X = %X.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %NotGenericNoParams.decl: type = interface_decl @NotGenericNoParams [template = constants.%NotGenericNoParams.type] {} {}
|
|
// CHECK:STDOUT: %NotGenericButParams.decl: %NotGenericButParams.type.f26 = interface_decl @NotGenericButParams [template = constants.%NotGenericButParams.generic] {} {}
|
|
// CHECK:STDOUT: %GenericAndParams.decl: %GenericAndParams.type.cde = interface_decl @GenericAndParams.1 [template = constants.%GenericAndParams.generic.827] {
|
|
// CHECK:STDOUT: %T.patt.loc6_28.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_28.2 (constants.%T.patt)]
|
|
// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc6_28.1, runtime_param<none> [symbolic = %T.patt.loc6_28.2 (constants.%T.patt)]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
|
|
// CHECK:STDOUT: %T.loc6_28.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_28.2 (constants.%T)]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
|
|
// CHECK:STDOUT: %T.patt.loc8_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt)]
|
|
// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc8_9.1, runtime_param<none> [symbolic = %T.patt.loc8_9.2 (constants.%T.patt)]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
|
|
// CHECK:STDOUT: %T.loc8_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_9.2 (constants.%T)]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {}
|
|
// CHECK:STDOUT: impl_decl @impl.1 [template] {} {
|
|
// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X]
|
|
// CHECK:STDOUT: %NotGenericNoParams.ref: type = name_ref NotGenericNoParams, file.%NotGenericNoParams.decl [template = constants.%NotGenericNoParams.type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %impl_witness.loc14: <witness> = impl_witness () [template = constants.%impl_witness]
|
|
// CHECK:STDOUT: impl_decl @impl.2 [template] {} {
|
|
// CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X]
|
|
// CHECK:STDOUT: %NotGenericButParams.ref: %NotGenericButParams.type.f26 = name_ref NotGenericButParams, file.%NotGenericButParams.decl [template = constants.%NotGenericButParams.generic]
|
|
// CHECK:STDOUT: %NotGenericButParams.type: type = facet_type <@NotGenericButParams> [template = constants.%NotGenericButParams.type.014]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %impl_witness.loc15: <witness> = impl_witness () [template = constants.%impl_witness]
|
|
// CHECK:STDOUT: impl_decl @impl.3 [template] {} {
|
|
// CHECK:STDOUT: %X.ref.loc16_6: type = name_ref X, file.%X.decl [template = constants.%X]
|
|
// CHECK:STDOUT: %GenericAndParams.ref: %GenericAndParams.type.cde = name_ref GenericAndParams, file.%GenericAndParams.decl [template = constants.%GenericAndParams.generic.827]
|
|
// CHECK:STDOUT: %X.ref.loc16_28: type = name_ref X, file.%X.decl [template = constants.%X]
|
|
// CHECK:STDOUT: %GenericAndParams.type: type = facet_type <@GenericAndParams.1, @GenericAndParams.1(constants.%X)> [template = constants.%GenericAndParams.type.4b6]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %impl_witness.loc16: <witness> = impl_witness () [template = constants.%impl_witness]
|
|
// CHECK:STDOUT: impl_decl @impl.4 [template] {} {
|
|
// CHECK:STDOUT: %X.ref.loc17_6: type = name_ref X, file.%X.decl [template = constants.%X]
|
|
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
|
|
// CHECK:STDOUT: %X.ref.loc17_13: type = name_ref X, file.%X.decl [template = constants.%X]
|
|
// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%X) [template = constants.%C.fac]
|
|
// CHECK:STDOUT: %GenericNoParams.ref: type = name_ref GenericNoParams, @C.%GenericNoParams.decl [template = constants.%GenericNoParams.type.f90]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %impl_witness.loc17: <witness> = impl_witness () [template = constants.%impl_witness]
|
|
// CHECK:STDOUT: impl_decl @impl.5 [template] {} {
|
|
// CHECK:STDOUT: %X.ref.loc18_6: type = name_ref X, file.%X.decl [template = constants.%X]
|
|
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
|
|
// CHECK:STDOUT: %X.ref.loc18_13: type = name_ref X, file.%X.decl [template = constants.%X]
|
|
// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%X) [template = constants.%C.fac]
|
|
// CHECK:STDOUT: %.loc18: %GenericAndParams.type.425 = specific_constant @C.%GenericAndParams.decl, @C(constants.%X) [template = constants.%GenericAndParams.generic.b50]
|
|
// CHECK:STDOUT: %GenericAndParams.ref: %GenericAndParams.type.425 = name_ref GenericAndParams, %.loc18 [template = constants.%GenericAndParams.generic.b50]
|
|
// CHECK:STDOUT: %X.ref.loc18_33: type = name_ref X, file.%X.decl [template = constants.%X]
|
|
// CHECK:STDOUT: %GenericAndParams.type: type = facet_type <@GenericAndParams.2, @GenericAndParams.2(constants.%X, constants.%X)> [template = constants.%GenericAndParams.type.79c]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %impl_witness.loc18: <witness> = impl_witness () [template = constants.%impl_witness]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @NotGenericNoParams {
|
|
// CHECK:STDOUT: %Self: %NotGenericNoParams.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.238]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @NotGenericButParams {
|
|
// CHECK:STDOUT: %Self: %NotGenericButParams.type.014 = bind_symbolic_name Self, 0 [symbolic = constants.%Self.43b]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic interface @GenericAndParams.1(%T.loc6_28.1: type) {
|
|
// CHECK:STDOUT: %T.loc6_28.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_28.2 (constants.%T)]
|
|
// CHECK:STDOUT: %T.patt.loc6_28.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_28.2 (constants.%T.patt)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %GenericAndParams.type: type = facet_type <@GenericAndParams.1, @GenericAndParams.1(%T.loc6_28.2)> [symbolic = %GenericAndParams.type (constants.%GenericAndParams.type.73e)]
|
|
// CHECK:STDOUT: %Self.2: %GenericAndParams.type.73e = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.2f4)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface {
|
|
// CHECK:STDOUT: %Self.1: @GenericAndParams.1.%GenericAndParams.type (%GenericAndParams.type.73e) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.2f4)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self.1
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic interface @GenericNoParams(@C.%T.loc8_9.1: type) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
|
|
// CHECK:STDOUT: %GenericNoParams.type: type = facet_type <@GenericNoParams, @GenericNoParams(%T)> [symbolic = %GenericNoParams.type (constants.%GenericNoParams.type.b79)]
|
|
// CHECK:STDOUT: %Self.2: %GenericNoParams.type.b79 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f6)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface {
|
|
// CHECK:STDOUT: %Self.1: @GenericNoParams.%GenericNoParams.type (%GenericNoParams.type.b79) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.0f6)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self.1
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic interface @GenericAndParams.2(@C.%T.loc8_9.1: type, %U.loc10_30.1: type) {
|
|
// CHECK:STDOUT: %U.loc10_30.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc10_30.2 (constants.%U)]
|
|
// CHECK:STDOUT: %U.patt.loc10_30.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc10_30.2 (constants.%U.patt)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
|
|
// CHECK:STDOUT: %GenericAndParams.type: type = facet_type <@GenericAndParams.2, @GenericAndParams.2(%T, %U.loc10_30.2)> [symbolic = %GenericAndParams.type (constants.%GenericAndParams.type.d96)]
|
|
// CHECK:STDOUT: %Self.2: %GenericAndParams.type.d96 = bind_symbolic_name Self, 2 [symbolic = %Self.2 (constants.%Self.37a)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface {
|
|
// CHECK:STDOUT: %Self.1: @GenericAndParams.2.%GenericAndParams.type (%GenericAndParams.type.d96) = bind_symbolic_name Self, 2 [symbolic = %Self.2 (constants.%Self.37a)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self.1
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: impl @impl.1: %X.ref as %NotGenericNoParams.ref {
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: witness = file.%impl_witness.loc14
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: impl @impl.2: %X.ref as %NotGenericButParams.type {
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: witness = file.%impl_witness.loc15
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: impl @impl.3: %X.ref.loc16_6 as %GenericAndParams.type {
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: witness = file.%impl_witness.loc16
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: impl @impl.4: %X.ref.loc17_6 as %GenericNoParams.ref {
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: witness = file.%impl_witness.loc17
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: impl @impl.5: %X.ref.loc18_6 as %GenericAndParams.type {
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: witness = file.%impl_witness.loc18
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic class @C(%T.loc8_9.1: type) {
|
|
// CHECK:STDOUT: %T.loc8_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_9.2 (constants.%T)]
|
|
// CHECK:STDOUT: %T.patt.loc8_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %GenericAndParams.type: type = generic_interface_type @GenericAndParams.2, @C(%T.loc8_9.2) [symbolic = %GenericAndParams.type (constants.%GenericAndParams.type.597)]
|
|
// CHECK:STDOUT: %GenericAndParams.generic: @C.%GenericAndParams.type (%GenericAndParams.type.597) = struct_value () [symbolic = %GenericAndParams.generic (constants.%GenericAndParams.generic.2ec)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class {
|
|
// CHECK:STDOUT: %GenericNoParams.decl: type = interface_decl @GenericNoParams [template = constants.%GenericNoParams.type.f90] {} {}
|
|
// CHECK:STDOUT: %GenericAndParams.decl: @C.%GenericAndParams.type (%GenericAndParams.type.597) = interface_decl @GenericAndParams.2 [symbolic = @C.%GenericAndParams.generic (constants.%GenericAndParams.generic.2ec)] {
|
|
// CHECK:STDOUT: %U.patt.loc10_30.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc10_30.2 (constants.%U.patt)]
|
|
// CHECK:STDOUT: %U.param_patt: type = value_param_pattern %U.patt.loc10_30.1, runtime_param<none> [symbolic = %U.patt.loc10_30.2 (constants.%U.patt)]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %U.param: type = value_param runtime_param<none>
|
|
// CHECK:STDOUT: %U.loc10_30.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc10_30.2 (constants.%U)]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%C.f2e
|
|
// CHECK:STDOUT: .GenericNoParams = %GenericNoParams.decl
|
|
// CHECK:STDOUT: .GenericAndParams = %GenericAndParams.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @X {
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%X
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @GenericAndParams.1(constants.%T) {
|
|
// CHECK:STDOUT: %T.loc6_28.2 => constants.%T
|
|
// CHECK:STDOUT: %T.patt.loc6_28.2 => constants.%T
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @GenericAndParams.1(%T.loc6_28.2) {}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @C(constants.%T) {
|
|
// CHECK:STDOUT: %T.loc8_9.2 => constants.%T
|
|
// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @GenericNoParams(constants.%T) {}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @GenericNoParams(%T) {}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @GenericAndParams.2(constants.%T, constants.%U) {
|
|
// CHECK:STDOUT: %U.loc10_30.2 => constants.%U
|
|
// CHECK:STDOUT: %U.patt.loc10_30.2 => constants.%U
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @GenericAndParams.2(%T, %U.loc10_30.2) {}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @C(%T.loc8_9.2) {}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @GenericAndParams.1(constants.%X) {
|
|
// CHECK:STDOUT: %T.loc6_28.2 => constants.%X
|
|
// CHECK:STDOUT: %T.patt.loc6_28.2 => constants.%X
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %GenericAndParams.type => constants.%GenericAndParams.type.4b6
|
|
// CHECK:STDOUT: %Self.2 => constants.%Self.2f4
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @C(constants.%X) {
|
|
// CHECK:STDOUT: %T.loc8_9.2 => constants.%X
|
|
// CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%X
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %GenericAndParams.type => constants.%GenericAndParams.type.425
|
|
// CHECK:STDOUT: %GenericAndParams.generic => constants.%GenericAndParams.generic.b50
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @GenericAndParams.2(constants.%X, constants.%X) {
|
|
// CHECK:STDOUT: %U.loc10_30.2 => constants.%X
|
|
// CHECK:STDOUT: %U.patt.loc10_30.2 => constants.%X
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %T => constants.%X
|
|
// CHECK:STDOUT: %GenericAndParams.type => constants.%GenericAndParams.type.79c
|
|
// CHECK:STDOUT: %Self.2 => constants.%Self.37a
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_non_generic_implicit_params.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %A.type.495: type = generic_interface_type @A [template]
|
|
// CHECK:STDOUT: %A.generic: %A.type.495 = struct_value () [template]
|
|
// CHECK:STDOUT: %A.type.c7f: type = facet_type <@A> [template]
|
|
// CHECK:STDOUT: %Self: %A.type.c7f = bind_symbolic_name Self, 0 [symbolic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .A = %A.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %A.decl: %A.type.495 = interface_decl @A [template = constants.%A.generic] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @A {
|
|
// CHECK:STDOUT: %Self: %A.type.c7f = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_non_generic_params.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %A.type.495: type = generic_interface_type @A [template]
|
|
// CHECK:STDOUT: %A.generic: %A.type.495 = struct_value () [template]
|
|
// CHECK:STDOUT: %A.type.c7f: type = facet_type <@A> [template]
|
|
// CHECK:STDOUT: %Self: %A.type.c7f = bind_symbolic_name Self, 0 [symbolic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .A = %A.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %A.decl: %A.type.495 = interface_decl @A [template = constants.%A.generic] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @A {
|
|
// CHECK:STDOUT: %Self: %A.type.c7f = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|