mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
33 lines
690 B
Plaintext
33 lines
690 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 I { fn F(); }
|
|
|
|
impl () as I {
|
|
fn F() {}
|
|
}
|
|
|
|
impl forall [template T:! type] (T,) as I {
|
|
fn F() {
|
|
if (true) {
|
|
T.(I.F)();
|
|
} else {
|
|
T.(I.F)();
|
|
}
|
|
}
|
|
}
|
|
|
|
fn Main() -> i32 {
|
|
// This would cause an exponential number of template instantiations if we
|
|
// didn't cache them.
|
|
((((((((((((((((((((((((((((((((),),),),),),),),),),),),),),),),),),),),),),),),),),),),),),)).(I.F)();
|
|
return 0;
|
|
}
|
|
|
|
// CHECK:STDOUT: result: 0
|