/
githubmirror
/
carbon-lang
Обзор
Документация
Войти
/
githubmirror
/
carbon-lang
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
toolchain/check/testdata/impl/impl_inside_interface.carbon
56 строк
3 KB
Chandler Carruth
Replace `:!` binding syntax with phase keywords and contextual defaults (#7479)
11 июл 2026, 04:22
Не верифицирован
11 июл 2026, 04:22
8be274c
Код
Авторство
О чём код?
// 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 // // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon // // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/impl_inside_interface.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/impl_inside_interface.carbon // --- fail_todo_impl_in_interface_definition.carbon library "[[@TEST_NAME]]"; // This test uses many unsupported features, and is expected to change. interface I { // CHECK:STDERR: fail_todo_impl_in_interface_definition.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` [SemanticsTodo] // CHECK:STDERR: default fn F() { // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default fn F() { class C {} // CHECK:STDERR: fail_todo_impl_in_interface_definition.carbon:[[@LINE+7]]:5: error: missing implementation of F in impl of interface I [ImplMissingFunction] // CHECK:STDERR: impl C as I {} // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_impl_in_interface_definition.carbon:[[@LINE-5]]:3: note: associated function F declared here [AssociatedFunctionHere] // CHECK:STDERR: default fn F() { // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: impl C as I {} } } // --- fail_todo_impl_in_interface_definition_with_associated.carbon library "[[@TEST_NAME]]"; // This test uses many unsupported features, and is expected to change. interface I { let U: type; // CHECK:STDERR: fail_todo_impl_in_interface_definition_with_associated.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` [SemanticsTodo] // CHECK:STDERR: default fn F() { // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default fn F() { class C {} // CHECK:STDERR: fail_todo_impl_in_interface_definition_with_associated.carbon:[[@LINE+7]]:5: error: missing implementation of F in impl of interface I [ImplMissingFunction] // CHECK:STDERR: impl C as I where .U = C {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_todo_impl_in_interface_definition_with_associated.carbon:[[@LINE-5]]:3: note: associated function F declared here [AssociatedFunctionHere] // CHECK:STDERR: default fn F() { // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: impl C as I where .U = C {} } }