-
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
41 changed files
with
62 additions
and
151 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 |
---|---|---|
|
@@ -4,8 +4,9 @@ | |
|
||
/// @assertion Let C be a class. ... It is a compile-time error if the interface | ||
/// of C has a method named n and a setter with basename n. | ||
/// @description Check that it is a compile-time error if the interface | ||
/// of C has a method named n and a setter with basename n. | ||
/// | ||
/// @description Check that it is a compile-time error if the interface of class | ||
/// `C` has a method named `n` and a setter with basename `n`. | ||
/// @author [email protected] | ||
class C { | ||
|
@@ -14,14 +15,14 @@ class C { | |
|
||
set s(var value) {} | ||
// ^ | ||
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_DEFINITION | ||
// [cfe] 's' is already declared in this scope. | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
set _s(var value) {} | ||
// ^^ | ||
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_DEFINITION | ||
// [cfe] '_s' is already declared in this scope. | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
} | ||
|
||
main() { | ||
new C(); | ||
print(C); | ||
} |
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 |
---|---|---|
|
@@ -4,57 +4,49 @@ | |
|
||
/// @assertion Let C be a class. It is a compile-time error if C declares a | ||
/// constructor named C.n and a static member with basename n. | ||
/// @description Check that it is a compile-time error if C declares a | ||
/// constructor named C.n and a static member with basename n | ||
/// | ||
/// @description Check that it is a compile-time error if class `C` declares a | ||
/// constructor named `C.n` and a static member with basename `n`. | ||
/// @author [email protected] | ||
/// @issue 46814 | ||
class C { | ||
C.s1() {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
static set s1(var value) {} | ||
// ^ | ||
// [cfe] unspecified | ||
|
||
C.s2() {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
static void s2() {} | ||
// ^ | ||
// [cfe] unspecified | ||
|
||
C.s3() {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
static int s3() => 1; | ||
// ^ | ||
// [cfe] unspecified | ||
|
||
C.s4() {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
static int get s4 => 1; | ||
// ^ | ||
// [cfe] unspecified | ||
|
||
C.s5() {} | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
static int s5 = 1; | ||
// ^ | ||
// [cfe] unspecified | ||
} | ||
|
||
main() { | ||
new C.s1(); | ||
new C.s2(); | ||
new C.s3(); | ||
new C.s4(); | ||
new C.s5(); | ||
print(C); | ||
} |
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 |
---|---|---|
|
@@ -6,9 +6,9 @@ | |
/// static member with basename n and the interface of C has an instance member | ||
/// with basename n | ||
/// | ||
/// @description Check that it is a compile-time error if C declares a static | ||
/// member with basename n and an instance member with basename n. Test instance | ||
/// setter | ||
/// @description Check that it is a compile-time error if class `C` declares a | ||
/// static member with basename `n` and an instance member with basename `n`. | ||
/// Test an instance setter. | ||
/// @author [email protected] | ||
/// @issue 46814 | ||
|
@@ -18,15 +18,12 @@ class C { | |
set s3(int v) {} | ||
set s4(int v) {} | ||
set s5(int v) {} | ||
// ^^ | ||
// [cfe] unspecified | ||
|
||
set _s1(int v) {} | ||
set _s2(int v) {} | ||
set _s3(int v) {} | ||
set _s4(int v) {} | ||
set _s5(int v) {} | ||
// ^^^ | ||
// [cfe] unspecified | ||
|
||
static set s1(var value) {} | ||
// ^^ | ||
|
@@ -72,5 +69,5 @@ class C { | |
} | ||
|
||
main() { | ||
new C(); | ||
print(C); | ||
} |
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 |
---|---|---|
|
@@ -6,34 +6,21 @@ | |
/// static member with basename n and the interface of C has an instance member | ||
/// with basename n | ||
/// | ||
/// @description Check that it is a compile-time error if C declares a static | ||
/// member with basename n and an instance member with basename n. Test instance | ||
/// variable | ||
/// @description Check that it is a compile-time error if class `C` declares a | ||
/// static member with basename `n` and an instance member with basename `n`. | ||
/// Test an instance variable. | ||
/// | ||
/// @Issue 47489 | ||
/// @author [email protected] | ||
class C { | ||
|
||
// For each 's1' and '_s1', two instance variables implicitly induce a getter | ||
// and a setter, so there is a conflict specified in 'Class Member Conflicts' | ||
// as well as a regular name clash. Dart produces two compile time errors here | ||
// whereas analyzer reports the 'Class Member Conflicts' error, and it seems | ||
// reasonable to omit the plain name clashes. | ||
int s1 = 1; | ||
// ^^ | ||
// [cfe] unspecified | ||
|
||
|
||
int s2 = 1; | ||
int s3 = 1; | ||
int s4 = 1; | ||
int s5 = 1; | ||
|
||
int _s1 = 1; | ||
// ^^ | ||
// [cfe] unspecified | ||
|
||
int _s2 = 1; | ||
int _s3 = 1; | ||
int _s4 = 1; | ||
|
@@ -92,5 +79,5 @@ class C { | |
} | ||
|
||
main() { | ||
new C(); | ||
print(C); | ||
} |
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
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 |
---|---|---|
|
@@ -4,24 +4,24 @@ | |
|
||
/// @assertion It is a compile error if a class declares a static getter named | ||
/// v and also has a non-static setter named v =. | ||
/// | ||
/// @description Checks that a compile error is arisen if a class has an | ||
/// explicitly declared static getter and an explicitly declared instance | ||
/// setter with the same name. | ||
/// @author [email protected] | ||
class C { | ||
int n = 0; | ||
|
||
static get v => 5; | ||
// ^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
set v(int v1) { | ||
n = v1; | ||
// ^ | ||
// [cfe] unspecified | ||
} | ||
} | ||
|
||
main() { | ||
C.v; | ||
print(C); | ||
} |
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
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
Oops, something went wrong.