Skip to content

Commit

Permalink
Fixes dart-lang#2117. Update assertions, add tests for external members
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrekhov committed Jul 12, 2023
1 parent 653867a commit c1f91c4
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
/// Ssuper, and let F be the return type of D. If both lookups failed, a
/// compile-time error occurs
///
/// @description Checks that it is a compile error if `S` does not have
/// an instance member named `m`.
/// @description Checks that it is a compile error if loockup of an instance
/// member named `m` in `S` failed.
/// @author msyabro
class S {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
/// Ssuper, and let F be the return type of D. If both lookups failed, a
/// compile-time error occurs
///
/// @description Checks that it is a compile error if member `m` in `S` is
/// inaccessible.
/// @description Checks that it is a compile error if loockup of an instance
/// member named `m` in `S` failed because member `m` in `S` is inaccessible.
/// @author msyabro
import '../lib.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
/// Ssuper, and let F be the return type of D. If both lookups failed, a
/// compile-time error occurs
///
/// @description Checks that it is a compile-time error if a superclass does not
/// have an instance member named `m`
/// @description Checks that it is a compile-time error if loockup for an
/// instance member named `m` failed
/// @author sgrekhov22@gmail.com
/// @issue 52901
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright (c) 2023, 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 Let Ssuper be the superclass of the immediately enclosing class
/// for i, and let L be the library that contains i. Let the declaration D be
/// the result of looking up the method m in Ssuper with respect to L, and let F
/// be the static type of D. Otherwise, if the method lookup failed, let the
/// declaration D be the result of looking up the getter m with respect to L in
/// Ssuper, and let F be the return type of D. If both lookups failed, a
/// compile-time error occurs
///
/// @description Checks that it is not an error if loockup for an instance
/// member named `m` successes. Test an external member (with no body but not an
/// abstract)
/// @author sgrekhov22@gmail.com
abstract class A {
external void m();
external int g;
external void set s(int i);
}

class C extends A {
void n() {
super.m();
super.g;
super.s = 0;
}
}

main() {
print(C);
}

0 comments on commit c1f91c4

Please sign in to comment.