mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 01:02:40 +00:00
Avoid duplicating a `Core` package into each test, point them to //toolchain/testing/min_prelude/convert.carbon which we add in this PR with the As and ImplicitAs interfaces. Move the tests of facet conversions from builtin_conversions/ to facet/ and the test of deducing through a member access into deduce/. This eliminates the check/testdata/builtin_conversions/ directory, which was making it hard to find where tests are for facet conversions. Now we have one fewer place, and facet/ seems to be a fine home for them.
16 lines
454 B
Plaintext
16 lines
454 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
|
|
|
|
// A minimal prelude for testing conversion between types.
|
|
package Core library "prelude";
|
|
|
|
interface As(Dest:! type) {
|
|
fn Convert[self: Self]() -> Dest;
|
|
}
|
|
|
|
interface ImplicitAs(Dest:! type) {
|
|
// TODO: extend As(Dest);
|
|
fn Convert[self: Self]() -> Dest;
|
|
}
|