fix: set StaticScope::NameStatus correctly for Associated Constants (#2752)

The StaticScope::NameStatus pattern is not being correctly follow for associated constant deceleration.

Closes #2728
Closes #2730
This commit is contained in:
Manmeet Singh
2023-04-10 13:21:32 -07:00
committed by GitHub
parent 72d8f86e79
commit d9e37da4fb
3 changed files with 42 additions and 1 deletions
@@ -0,0 +1,19 @@
// 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: %{not} %{explorer-run}
// RUN: %{not} %{explorer-run-trace}
package ExplorerTest api;
interface IFace {
// CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/interface/fail_use_assoc_const_before_decl.carbon:[[@LINE+1]]: 'C' has not been declared yet
let B:! C;
let C:! IFace;
}
fn Main() -> i32 {
// return T;
}
@@ -0,0 +1,18 @@
// 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: %{not} %{explorer-run}
// RUN: %{not} %{explorer-run-trace}
package ExplorerTest api;
interface IFace {
// CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/interface/fail_use_assoc_const_in_defn.carbon:[[@LINE+1]]: 'T' is not usable until after it has been completely declared
let T:! T.IFace;
}
fn Main() -> i32 {
return 0;
}