-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
7 changed files
with
142 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// 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 a type named `_` is still accessible and can be | ||
/// used. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=wildcard-variables | ||
|
||
class _ {} | ||
|
||
main() { | ||
_ v = _(); | ||
print(_); | ||
} |
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,19 @@ | ||
// 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 a type named `_` is still accessible and can be | ||
/// used. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=wildcard-variables | ||
|
||
mixin _ {} | ||
|
||
main() { | ||
print(_); | ||
} |
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,20 @@ | ||
// 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 a type named `_` is still accessible and can be | ||
/// used. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=wildcard-variables | ||
|
||
enum _ {e1;} | ||
|
||
main() { | ||
print(_); | ||
print(_.e1); | ||
} |
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,19 @@ | ||
// 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 a type named `_` is still accessible and can be | ||
/// used. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=wildcard-variables | ||
|
||
extension type _(int id) {} | ||
|
||
main() { | ||
print(_); | ||
} |
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,22 @@ | ||
// 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 a type named `_` is still accessible and can be | ||
/// used. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=wildcard-variables | ||
|
||
class A {} | ||
extension _ on A { | ||
static int s = 42; | ||
} | ||
|
||
main() { | ||
print(_.s); | ||
} |
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,20 @@ | ||
// 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 a type alias named `_` is still accessible and can | ||
/// be used. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=wildcard-variables | ||
|
||
class C {} | ||
typedef _ = C; | ||
|
||
main() { | ||
print(_); | ||
} |
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,22 @@ | ||
// 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 a type alias named `_` is still accessible and can | ||
/// be used. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=wildcard-variables | ||
|
||
import '../../Utils/expect.dart'; | ||
|
||
typedef int _(String s); | ||
|
||
main() { | ||
_ f = (String s) {return 42;}; | ||
Expect.equals(42, f("")); | ||
} |