blob: 87e3a708356875b688e74d066353f15e1b260c64 [file] [log] [blame]
// Copyright (c) 2020, 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.
// Verifies that optional parameters can be transformed in field initializers.
// Regression test for https://github.com/flutter/flutter/issues/56479.
import "package:expect/expect.dart";
int bar({int x = 2}) => x + 1;
class A {
static int foo = bar(x: 42);
}
main() {
Expect.equals(5, bar(x: 4));
Expect.equals(43, A.foo);
}