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:
Richard Smith
2023-02-22 13:51:25 -08:00
committed by GitHub
parent 9df70fb115
commit 7fe06a5d2f
4 changed files with 110 additions and 61 deletions
@@ -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;
}