blob: a4bfdba7ab7ca86c48be3fe8af6e3e7db1d23ea7 [file] [log] [blame]
// Copyright (c) 2022, 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.
// Test for external constructors.
// @dart = 2.9
import "package:expect/expect.dart";
class A {
final int field;
const A(this.field);
external const A.foo(dynamic arg);
}
class B extends A {
const B(int abc) : super(abc);
B.foo(dynamic arg) : super.foo(arg);
}
void main() {
Expect.throws(() {
A.foo(42);
}, (e) => e is NoSuchMethodError);
Expect.throws(() {
B.foo(42);
}, (e) => e is NoSuchMethodError);
}