Files
sdk/tests/language_2/nnbd/syntax/required_modifier_test.dart
T
Dan Rubel 293c0f42f7 NNBD "required" modifier language_2 tests
Change-Id: I2c0d53fd321dea7ed74cf9fac422ec32f9dea641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-23 15:28:12 +00:00

18 lines
468 B
Dart

// Copyright (c) 2019, 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.
// SharedOptions=--enable-experiment=non-nullable
import 'package:expect/expect.dart';
int f({required int i}) => i + 1;
class C {
m(int a, {required int i}) => a + i;
}
main() {
Expect.equals(f(i: 2), 3);
Expect.equals(C().m(4, i: 5), 9);
}