Skip to content

Fixes #2117. Update assertions, add tests for external members #2126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 [email protected]
/// @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 [email protected]

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);
}