forked from dart-lang/co19
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dart-lang#2641. Add tests for multiple top-level declarations named
_
- Loading branch information
Showing
13 changed files
with
883 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
/// @assertion Other declarations: top-level variables, top-level function | ||
/// names, type names, member names, etc. are unchanged. They can be named `_` | ||
/// as they are today. | ||
/// | ||
/// @description Checks that any top-level declaration named `_` is a | ||
/// compile-time error if there is an earlier declaration of a top-level | ||
/// variable named `_`. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=wildcard-variables | ||
|
||
var _; | ||
|
||
int _ = 1; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
const _ = 1; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
int _() => 42; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
int get _ => 42; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
class _ {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
mixin _ {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
enum _ {e1;} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
extension type _(int id) {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
class A {} | ||
extension _ on A {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
typedef _ = A; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
typedef void _(); | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
/// @assertion Other declarations: top-level variables, top-level function | ||
/// names, type names, member names, etc. are unchanged. They can be named `_` | ||
/// as they are today. | ||
/// | ||
/// @description Checks that any top-level declaration named `_` is a | ||
/// compile-time error if there is an earlier declaration of a top-level | ||
/// constant named `_`. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=wildcard-variables | ||
|
||
const _ = 42; | ||
|
||
int _ = 1; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
const _ = 1; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
int _() => 42; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
int get _ => 42; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
class _ {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
mixin _ {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
enum _ {e1;} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
extension type _(int id) {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
class A {} | ||
extension _ on A {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
typedef _ = A; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
typedef void _(); | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
/// @assertion Other declarations: top-level variables, top-level function | ||
/// names, type names, member names, etc. are unchanged. They can be named `_` | ||
/// as they are today. | ||
/// | ||
/// @description Checks that any top-level declaration named `_` is a | ||
/// compile-time error if there is an earlier declaration of a top-level | ||
/// function named `_`. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=wildcard-variables | ||
|
||
void _() {} | ||
|
||
int _ = 1; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
const _ = 1; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
int _() => 42; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
int get _ => 42; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
class _ {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
mixin _ {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
enum _ {e1;} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
extension type _(int id) {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
class A {} | ||
extension _ on A {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
typedef _ = A; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
typedef void _(); | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
/// @assertion Other declarations: top-level variables, top-level function | ||
/// names, type names, member names, etc. are unchanged. They can be named `_` | ||
/// as they are today. | ||
/// | ||
/// @description Checks that any top-level declaration named `_` is a | ||
/// compile-time error if there is an earlier declaration of a top-level | ||
/// getter named `_`. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=wildcard-variables | ||
|
||
int get _ => 0; | ||
|
||
int _ = 1; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
const _ = 1; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
int _() => 42; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
int get _ => 42; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
class _ {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
mixin _ {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
enum _ {e1;} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
extension type _(int id) {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
class A {} | ||
extension _ on A {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
typedef _ = A; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
typedef void _(); | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
/// @assertion Other declarations: top-level variables, top-level function | ||
/// names, type names, member names, etc. are unchanged. They can be named `_` | ||
/// as they are today. | ||
/// | ||
/// @description Checks that any top-level declaration named `_` is a | ||
/// compile-time error if there is an earlier declaration of a class named `_`. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=wildcard-variables | ||
|
||
class _ {} | ||
|
||
int _ = 1; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
const _ = 1; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
int _() => 42; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
int get _ => 42; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
class _ {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
mixin _ {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
enum _ {e1;} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
extension type _(int id) {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
class A {} | ||
extension _ on A {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
typedef _ = A; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
typedef void _(); | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
Oops, something went wrong.