mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-30 10:05:00 +01:00
Allow interleaving of STDOUT and STDERR check lines. Put STDOUT lines after the line they're attached to, and STDERR lines before. If no STDOUT check line is attached to any line, then put them all at the end of the file instead. This is intended to better handle the case where stdout contains unreplaced mentions of line numbers, and also reflects that stdout is typically a consequence of the test rather than commentary on it, so placing it after the test seems likely to read better.
48 lines
841 B
Plaintext
48 lines
841 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
|
|
//
|
|
// AUTOUPDATE
|
|
|
|
package ExplorerTest api;
|
|
|
|
interface HasType {
|
|
let AssocType:! type;
|
|
}
|
|
|
|
interface Iface {
|
|
fn F();
|
|
}
|
|
|
|
impl forall [T:! HasType where .Self.AssocType impls Iface] T as Iface {
|
|
fn F() {
|
|
Print("T as Iface");
|
|
T.AssocType.(Iface.F)();
|
|
}
|
|
}
|
|
|
|
class A {
|
|
extend impl as Iface {
|
|
fn F() { Print("A as Iface"); }
|
|
}
|
|
}
|
|
|
|
class B {
|
|
extend impl as HasType where .AssocType = A {}
|
|
}
|
|
|
|
class C {
|
|
extend impl as HasType where .AssocType = B {}
|
|
}
|
|
|
|
fn Main() -> i32 {
|
|
let c: C = {};
|
|
c.(Iface.F)();
|
|
return 0;
|
|
}
|
|
|
|
// CHECK:STDOUT: T as Iface
|
|
// CHECK:STDOUT: T as Iface
|
|
// CHECK:STDOUT: A as Iface
|
|
// CHECK:STDOUT: result: 0
|