Handle identifier value category properly. (#986)

This commit is contained in:
Geoff Romer
2021-12-15 13:27:36 -08:00
committed by GitHub
parent daf8729a75
commit c89ce1d570
9 changed files with 99 additions and 48 deletions
@@ -2,12 +2,12 @@
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// RUN: %{executable_semantics} %s 2>&1 | \
// RUN: %{not} %{executable_semantics} %s 2>&1 | \
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s
// RUN: %{executable_semantics} --trace %s 2>&1 | \
// RUN: %{not} %{executable_semantics} --trace %s 2>&1 | \
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s
// AUTOUPDATE: %{executable_semantics} %s
// CHECK: result: 0
// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/basic_syntax/fail_assign_to_function.carbon:18: Cannot assign to rvalue 'F'
package ExecutableSemanticsTest api;
@@ -15,8 +15,6 @@ fn F() {}
fn G() {}
fn Main() -> i32 {
// TODO: this test should not pass. See comments on the handling of
// IdentifierExpression in type_checker.cpp.
F = G;
return 0;
}