Skip to content

Commit c1f91c4

Browse files
committed
Fixes dart-lang#2117. Update assertions, add tests for external members
1 parent 653867a commit c1f91c4

File tree

4 files changed

+40
-6
lines changed

4 files changed

+40
-6
lines changed

Language/Expressions/Method_Invocation/Super_Invocation/accessible_instance_member_t01.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
/// Ssuper, and let F be the return type of D. If both lookups failed, a
1111
/// compile-time error occurs
1212
///
13-
/// @description Checks that it is a compile error if `S` does not have
14-
/// an instance member named `m`.
13+
/// @description Checks that it is a compile error if loockup of an instance
14+
/// member named `m` in `S` failed.
1515
/// @author msyabro
1616
1717
class S {}

Language/Expressions/Method_Invocation/Super_Invocation/accessible_instance_member_t02.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
/// Ssuper, and let F be the return type of D. If both lookups failed, a
1111
/// compile-time error occurs
1212
///
13-
/// @description Checks that it is a compile error if member `m` in `S` is
14-
/// inaccessible.
13+
/// @description Checks that it is a compile error if loockup of an instance
14+
/// member named `m` in `S` failed because member `m` in `S` is inaccessible.
1515
/// @author msyabro
1616
1717
import '../lib.dart';

Language/Expressions/Method_Invocation/Super_Invocation/accessible_instance_member_t03.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
/// Ssuper, and let F be the return type of D. If both lookups failed, a
1111
/// compile-time error occurs
1212
///
13-
/// @description Checks that it is a compile-time error if a superclass does not
14-
/// have an instance member named `m`
13+
/// @description Checks that it is a compile-time error if loockup for an
14+
/// instance member named `m` failed
1515
/// @author [email protected]
1616
/// @issue 52901
1717
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
/// @assertion Let Ssuper be the superclass of the immediately enclosing class
6+
/// for i, and let L be the library that contains i. Let the declaration D be
7+
/// the result of looking up the method m in Ssuper with respect to L, and let F
8+
/// be the static type of D. Otherwise, if the method lookup failed, let the
9+
/// declaration D be the result of looking up the getter m with respect to L in
10+
/// Ssuper, and let F be the return type of D. If both lookups failed, a
11+
/// compile-time error occurs
12+
///
13+
/// @description Checks that it is not an error if loockup for an instance
14+
/// member named `m` successes. Test an external member (with no body but not an
15+
/// abstract)
16+
/// @author [email protected]
17+
18+
abstract class A {
19+
external void m();
20+
external int g;
21+
external void set s(int i);
22+
}
23+
24+
class C extends A {
25+
void n() {
26+
super.m();
27+
super.g;
28+
super.s = 0;
29+
}
30+
}
31+
32+
main() {
33+
print(C);
34+
}

0 commit comments

Comments
 (0)