mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 12:31:04 +01:00
Implement auto return types, removing => returns (#850)
This implements #826, I think covering everything important there. Regarding ReturnTypeContext, I broke that out because it started feeling like a significant number of args to be passing around, and I think this makes the association inside type checking clearer. Co-authored-by: Geoff Romer <gromer@google.com>
This commit is contained in:
committed by
GitHub
co-authored by
Geoff Romer
parent
04ab30f231
commit
5aa958345b
@@ -1,20 +0,0 @@
|
||||
// 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
|
||||
//
|
||||
// RUN: not executable_semantics %s 2>&1 | \
|
||||
// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s
|
||||
// RUN: not executable_semantics --trace %s 2>&1 | \
|
||||
// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s
|
||||
// AUTOUPDATE: executable_semantics %s
|
||||
// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/return/fail_auto.carbon:14: syntax error, unexpected AUTO
|
||||
|
||||
package ExecutableSemanticsTest api;
|
||||
|
||||
fn F() -> auto {
|
||||
return 0;
|
||||
}
|
||||
|
||||
fn main() -> i32 {
|
||||
return F();
|
||||
}
|
||||
Reference in New Issue
Block a user