Files
carbon-lang/explorer/testdata/namespace/generic_parameter_scope.carbon
T
Richard Smith 4fa71e32f5 Add support for most kinds of declarations to be declared and used as namespace members (#2575)
Support for global variables is still missing; they're a bit more tricky because they use a pattern to introduce their name.

Prior to this change, explorer heavily relied on name comparisons to determine whether two declarations declare the same entity. Some of those instances are fixed in this PR, but more remain to be fixed, and some TODOs are added for some harder-to-fix instances.
2023-02-08 13:21:15 -08:00

26 lines
662 B
Plaintext

// 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;
// Check that even generic parameters are looked up in the namespace of an
// entity.
namespace N;
interface N.Interface {}
class N.A(T:! Interface) {}
interface N.B(T:! Interface) {}
constraint N.C(T:! Interface) {}
__mixin N.D(T:! Interface) {}
choice N.E(T:! Interface) {}
fn N.F[T:! Interface](a: A(T)) {}
fn Main() -> i32 { return 0; }