mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 19:55:11 +00:00
Now that included files can specify `EXTRA-ARGS`, this uses that to handle min_prelude files. Also moves `As`/`ImplicitAs` out to a shared file, partly because we duplicate it a few times over, partly just to show that it works. Also removes the `min_prelude/` subdirectories because many of these files were touched by autoupdate regardless. I noticed one conflict for `impl_thunk.carbon`, so renaming that one to `impl_thunk_min_prelude.carbon`. `GetArgReplacements` I simply noticed was unused, so removing it.
33 lines
992 B
Plaintext
33 lines
992 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/min_prelude/facet_types.carbon
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/lookup/import_final.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/import_final.carbon
|
|
|
|
// --- interface_z.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface Z {
|
|
let X:! type;
|
|
}
|
|
|
|
class C {}
|
|
final impl forall [T:! type] T as Z where .X = C {}
|
|
|
|
// --- import_final.carbon
|
|
library "[[@TEST_NAME]]";
|
|
|
|
import library "interface_z";
|
|
|
|
fn F[U:! type](T:! Z) {
|
|
// The value of `.X` can be known to be `C` here when the impl `T as Z(C)` is
|
|
// final.
|
|
let a: T.X = {} as C;
|
|
}
|