mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-27 22:02:33 +01:00
This fixes some bugs in each, where the fixes had only been made on one side of the switch or the other. Also don't forget to instantiate deduced generic arguments in a call when we read them out of the AST.
23 lines
520 B
Plaintext
23 lines
520 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
|
|
// RUN: %{explorer-run}
|
|
// RUN: %{explorer-run-trace}
|
|
// CHECK:STDOUT: result: 0
|
|
|
|
package ExplorerTest api;
|
|
|
|
fn ReturnIndirectly[T:! type](direct: bool, x: T) -> type {
|
|
if (direct) {
|
|
return T;
|
|
} else {
|
|
return ReturnIndirectly(true, x);
|
|
}
|
|
}
|
|
|
|
fn Main() -> ReturnIndirectly(false, 0) {
|
|
return 0;
|
|
}
|