-
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
12 changed files
with
356 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
Language/Expressions/Identifier_Reference/built_in_identifier_A14_t01.dart
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,31 @@ | ||
// 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 It is a syntax error if a built-in identifier is used as the | ||
/// declared name of a prefix, class, mixin, enum, type parameter, type alias, | ||
/// or extension. | ||
/// | ||
/// @description Checks that it is a compile-time error if a built-in identifier | ||
/// `inout` is used as the declared name of a class, mixin or enum. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=variance | ||
|
||
class inout {} | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
mixin inout {} | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
enum inout {e1;} | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
44 changes: 44 additions & 0 deletions
44
Language/Expressions/Identifier_Reference/built_in_identifier_A14_t02.dart
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,44 @@ | ||
// 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 It is a syntax error if a built-in identifier is used as the | ||
/// declared name of a prefix, class, mixin, enum, type parameter, type alias, | ||
/// or extension. | ||
/// | ||
/// @description Checks that it is a compile-time error if a built-in identifier | ||
/// `inout` is used as the declared name of a type variable. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=variance | ||
|
||
class C<inout> { | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
} | ||
|
||
mixin M<inout> { | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
} | ||
|
||
enum E<inout> { | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
e1; | ||
} | ||
|
||
void foo<inout>() {} | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
print(C); | ||
print(M); | ||
print(E); | ||
print(foo); | ||
} |
26 changes: 26 additions & 0 deletions
26
Language/Expressions/Identifier_Reference/built_in_identifier_A14_t03.dart
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,26 @@ | ||
// 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 It is a syntax error if a built-in identifier is used as the | ||
/// declared name of a prefix, class, mixin, enum, type parameter, type alias, | ||
/// or extension. | ||
/// | ||
/// @description Checks that it is a compile-time error if a built-in identifier | ||
/// `inout` is used as the declared name of a type alias. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=variance | ||
|
||
typedef int inout(); | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
typedef inout = int; | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
22 changes: 22 additions & 0 deletions
22
Language/Expressions/Identifier_Reference/built_in_identifier_A14_t04.dart
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 It is a syntax error if a built-in identifier is used as the | ||
/// declared name of a prefix, class, mixin, enum, type parameter, type alias, | ||
/// or extension. | ||
/// | ||
/// @description Checks that it is a compile-time error if a built-in identifier | ||
/// `inout` is used as the declared name of a prefix. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=variance | ||
|
||
import "../lib.dart" as inout; | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
inout.x; | ||
} |
21 changes: 21 additions & 0 deletions
21
Language/Expressions/Identifier_Reference/built_in_identifier_A14_t05.dart
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,21 @@ | ||
// 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 It is a syntax error if a built-in identifier is used as the | ||
/// declared name of a prefix, class, mixin, enum, type parameter, type alias, | ||
/// or extension. | ||
/// | ||
/// @description Checks that it is a compile-time error if a built-in identifier | ||
/// `inout` is used as the name of an extension. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=variance | ||
|
||
extension inout on int {} | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
34 changes: 34 additions & 0 deletions
34
Language/Expressions/Identifier_Reference/built_in_identifier_A14_t06.dart
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,34 @@ | ||
// 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 It is a syntax error if a built-in identifier is used as the | ||
/// declared name of a prefix, class, mixin, enum, type parameter, type alias, | ||
/// or extension. | ||
/// | ||
/// @description Checks that it is a compile-time error if a built-in identifier | ||
/// `inout` is used as the name, type parameter or alias of an extension | ||
/// type | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=inline-class,variance | ||
|
||
extension type inout(int _) {} | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
extension type ListET<inout>(List<inout> _) {} | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
extension type ET(int _) {} | ||
|
||
typedef inout = ET; | ||
// ^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
31 changes: 31 additions & 0 deletions
31
Language/Expressions/Identifier_Reference/built_in_identifier_A20_t01.dart
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,31 @@ | ||
// 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 It is a syntax error if a built-in identifier is used as the | ||
/// declared name of a prefix, class, mixin, enum, type parameter, type alias, | ||
/// or extension. | ||
/// | ||
/// @description Checks that it is a compile-time error if a built-in identifier | ||
/// `out` is used as the declared name of a class, mixin or enum. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=variance | ||
|
||
class out {} | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
mixin out {} | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
enum out {e1;} | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
44 changes: 44 additions & 0 deletions
44
Language/Expressions/Identifier_Reference/built_in_identifier_A20_t02.dart
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,44 @@ | ||
// 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 It is a syntax error if a built-in identifier is used as the | ||
/// declared name of a prefix, class, mixin, enum, type parameter, type alias, | ||
/// or extension. | ||
/// | ||
/// @description Checks that it is a compile-time error if a built-in identifier | ||
/// `out` is used as the declared name of a type variable. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=variance | ||
|
||
class C<out> { | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
} | ||
|
||
mixin M<out> { | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
} | ||
|
||
enum E<out> { | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
e1; | ||
} | ||
|
||
void foo<out>() {} | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
print(C); | ||
print(M); | ||
print(E); | ||
print(foo); | ||
} |
26 changes: 26 additions & 0 deletions
26
Language/Expressions/Identifier_Reference/built_in_identifier_A20_t03.dart
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,26 @@ | ||
// 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 It is a syntax error if a built-in identifier is used as the | ||
/// declared name of a prefix, class, mixin, enum, type parameter, type alias, | ||
/// or extension. | ||
/// | ||
/// @description Checks that it is a compile-time error if a built-in identifier | ||
/// `out` is used as the declared name of a type alias. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=variance | ||
|
||
typedef int out(); | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
typedef out = int; | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
22 changes: 22 additions & 0 deletions
22
Language/Expressions/Identifier_Reference/built_in_identifier_A20_t04.dart
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 It is a syntax error if a built-in identifier is used as the | ||
/// declared name of a prefix, class, mixin, enum, type parameter, type alias, | ||
/// or extension. | ||
/// | ||
/// @description Checks that it is a compile-time error if a built-in identifier | ||
/// `out` is used as the declared name of a prefix. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=variance | ||
|
||
import "../lib.dart" as out; | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
out.x; | ||
} |
21 changes: 21 additions & 0 deletions
21
Language/Expressions/Identifier_Reference/built_in_identifier_A20_t05.dart
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,21 @@ | ||
// 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 It is a syntax error if a built-in identifier is used as the | ||
/// declared name of a prefix, class, mixin, enum, type parameter, type alias, | ||
/// or extension. | ||
/// | ||
/// @description Checks that it is a compile-time error if a built-in identifier | ||
/// `out` is used as the name of an extension. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=variance | ||
|
||
extension out on int {} | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
34 changes: 34 additions & 0 deletions
34
Language/Expressions/Identifier_Reference/built_in_identifier_A20_t06.dart
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,34 @@ | ||
// 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 It is a syntax error if a built-in identifier is used as the | ||
/// declared name of a prefix, class, mixin, enum, type parameter, type alias, | ||
/// or extension. | ||
/// | ||
/// @description Checks that it is a compile-time error if a built-in identifier | ||
/// `out` is used as the name, type parameter or alias of an extension | ||
/// type | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=inline-class,variance | ||
|
||
extension type out(int _) {} | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
extension type ListET<out>(List<out> _) {} | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
extension type ET(int _) {} | ||
|
||
typedef out = ET; | ||
// ^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |