Files
carbon-lang/explorer/testdata/namespace/fail_member_namespace.carbon
T
Jon Ross-Perkins f71a3b71b4 Disallow namespaces as class members (#2996)
Breaking apart namespaces from the main declaration list is, I think,
the most scalable approach to this. If we have more divergence in
supported declarations it gives a fairly straightforward way for
splitting, and roughly mirrors how class_body splits.

Fixes #2980
2023-07-19 01:02:47 +00:00

15 lines
414 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
package Foo api;
class C {
// CHECK:STDERR: SYNTAX ERROR: fail_member_namespace.carbon:[[@LINE+1]]: syntax error, unexpected NAMESPACE, expecting CLASS
namespace N;
}
fn Main() -> i32 { return 0; }