mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 22:48:10 +00:00
These were introduced in proposal #5168. Details: https://github.com/carbon-language/carbon-lang/blob/b7ea32c3a49620fae12f0b2298c81d429a20eab3/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md#associated-constants-may-be-assigned-in-the-body-of-an-impl-definition
42 lines
2.0 KiB
Plaintext
42 lines
2.0 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/parse/testdata/where_assignment/basic.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/where_assignment/basic.carbon
|
|
|
|
impl C as Z {
|
|
where Z1 = D.(Y.Y1);
|
|
where Z2 = Z1;
|
|
}
|
|
|
|
// CHECK:STDOUT: - filename: basic.carbon
|
|
// CHECK:STDOUT: ╭─FileStart ''
|
|
// CHECK:STDOUT: │ ╭─ImplIntroducer 'impl'
|
|
// CHECK:STDOUT: │ │ ╭─IdentifierNameExpr 'C'
|
|
// CHECK:STDOUT: │ ├─ImplTypeAs 'as'
|
|
// CHECK:STDOUT: │ ├─IdentifierNameExpr 'Z'
|
|
// CHECK:STDOUT: │ ╭─ImplDefinitionStart '{'
|
|
// CHECK:STDOUT: │ │ ╭─WhereAssignmentIntroducer 'where'
|
|
// CHECK:STDOUT: │ │ │ ╭─IdentifierNameNotBeforeSignature 'Z1'
|
|
// CHECK:STDOUT: │ │ │ │ ╭─IdentifierNameExpr 'D'
|
|
// CHECK:STDOUT: │ │ │ │ │ ╭─ParenExprStart '('
|
|
// CHECK:STDOUT: │ │ │ │ │ │ ╭─IdentifierNameExpr 'Y'
|
|
// CHECK:STDOUT: │ │ │ │ │ │ ├─IdentifierNameNotBeforeSignature 'Y1'
|
|
// CHECK:STDOUT: │ │ │ │ │ ├─MemberAccessExpr '.'
|
|
// CHECK:STDOUT: │ │ │ │ ├─ParenExpr ')'
|
|
// CHECK:STDOUT: │ │ │ ├─MemberAccessExpr '.'
|
|
// CHECK:STDOUT: │ │ ├─WhereAssignmentOperator '='
|
|
// CHECK:STDOUT: │ ├─WhereAssignmentDecl ';'
|
|
// CHECK:STDOUT: │ │ ╭─WhereAssignmentIntroducer 'where'
|
|
// CHECK:STDOUT: │ │ │ ╭─IdentifierNameNotBeforeSignature 'Z2'
|
|
// CHECK:STDOUT: │ │ │ ├─IdentifierNameExpr 'Z1'
|
|
// CHECK:STDOUT: │ │ ├─WhereAssignmentOperator '='
|
|
// CHECK:STDOUT: │ ├─WhereAssignmentDecl ';'
|
|
// CHECK:STDOUT: ├─ImplDefinition '}'
|
|
// CHECK:STDOUT: ├─FileEnd ''
|
|
// CHECK:STDOUT: (root)
|