blob: 445037b3353086eb4c6705450060fa349e92f62c [file] [log] [blame] [edit]
// Copyright (c) 2021, 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.
// Regression test for https://github.com/dart-lang/sdk/issues/45306.
// Verifies that ScopeBuilder doesn't crash on an async closure inside
// instance field initializer.
class X {
late final Y y = Y(() async {});
final double? a;
final double? b;
final String? c;
X({this.a, this.b, this.c});
}
typedef Callback = Future<void> Function();
class Y {
Y(Callback? f);
}
void main() {
X();
}