Skip to content

Commit

Permalink
#2117. Update accessible_instance_member_t* tests (#2122)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrekhov authored Jul 11, 2023
1 parent 51a5508 commit c0bcb74
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
// 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 Sstatic be the superclass of the immediately enclosing class.
/// It is a static type warning if Sstatic does not have an accessible instance
/// member named m unless Sstatic or a superinterface of Sstatic is annotated
/// with an annotation denoting a constant identical to the constant @proxy
/// defined in dart:core.
/// @description Checks that it is a compile error if S does not have
/// an instance member named m.
/// @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 a compile error if `S` does not have
/// an instance member named `m`.
/// @author msyabro

class S {}

class A extends S {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
// 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 Sstatic be the superclass of the immediately enclosing class.
/// It is a static type warning if Sstatic does not have an accessible instance
/// member named m unless Sstatic or a superinterface of Sstatic is annotated
/// with an annotation denoting a constant identical to the constant @proxy
/// defined in dart:core.
/// @description Checks that it is a compile error if member m in S is
/// @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 a compile error if member `m` in `S` is
/// inaccessible.
/// @author msyabro

import '../lib.dart';

class A extends C {
test() {
super._func();
// ^
// ^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// 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 Sstatic be the superclass of the immediately enclosing class.
/// It is a static type warning if Sstatic does not have an accessible instance
/// member named m unless Sstatic or a superinterface of Sstatic is annotated
/// with an annotation denoting a constant identical to the constant @proxy
/// defined in dart:core.
/// @description Checks that it is a compile error if superclass
/// does not have an instance member named m
/// @author kaigorodov
/// @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 a compile-time error if a superclass does not
/// have an instance member named `m`
/// @author sgrekhov22@gmail.com
/// @issue 52901
class S {}
abstract class A {
void m();
}

class A extends S {
test() {
super.nonExistingMethod();
abstract class C extends A {
void n() {
super.m();
// ^
// [analyzer] unspecified
// [cfe] unspecified
}
}

main() {
A a = new A();
print(C);
}

This file was deleted.

This file was deleted.

0 comments on commit c0bcb74

Please sign in to comment.