Files
sdk/pkg/front_end/testcases/general/external_constructor.dart
T
Jens Johansen 9abc9fc4d7 [CFE] Strong/weak suites takes error-and-ok-comments into account
A line marked with "// error" should get an error (or it's an error),
and one marked with "// ok" should not get an error (and if it does it's
an error).

Some tests are left unhandled and are programatically ignored in this
first CL. A bug (https://github.com/dart-lang/sdk/issues/54635) has
been filed to sort those out.

Change-Id: I083f62829ceff6ff85121e21cfdb6670bfacb7e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346301
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-01-18 14:40:08 +00:00

44 lines
673 B
Dart

// 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.
abstract class A {}
class B {
final A a;
external B(A a); // Ok
}
class C {
final A a1;
final A a2;
external C(); // Ok
C.named(this.a1, this.a2); // Ok
}
class D {
final A a1;
final A a2;
external D(); // Ok
D.named(this.a1); // Error
}
class E {
final A a1;
final A a2;
E(this.a2); // Error
external E.named(); // Ok
}
class F {
final A a1;
final A a2;
F(this.a1, this.a2); // Ok
external F.named(); // Ok
}