mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:24:42 +01:00
Unify handling of calls to functions and to methods. (#2620)
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.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// 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;
|
||||
}
|
||||
Reference in New Issue
Block a user