Files
carbon-lang/toolchain/check/testdata/impl/impl_inside_interface.carbon
T
Christopher Di BellaandRichard Smith 0f06fe65fa Add interface modifiers (#7625)
This adds most support for default and final methods. Missing components
include rejecting definitions for non-default/final methods, and
permitting out-of-line definitions.

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2026-08-17 20:49:23 +00:00

33 lines
952 B
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
//
// 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
// --- impl_in_interface_definition.carbon
library "[[@TEST_NAME]]";
interface I {
default fn F() {
class C {}
impl C as I {}
}
}
// --- impl_in_interface_definition_with_associated.carbon
library "[[@TEST_NAME]]";
interface I {
let U: type;
default fn F() {
class C {}
impl C as I where .U = C {}
}
}