// 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

// Test that it is an error if a named parameter that is part of a required
// group is not bound to an argument at a call site.
typedef String F({required String x});

class A {
  A({required int a}) {}
  A.named() : this(); //# 01: compile-time error
  void m1({required int a}) {}
  F m2() => ({required String x}) => null;
}

class B extends A { B() : super(); } //# 02: compile-time error

void f({required int a}) {}

void Function({required int a}) g() => null;

main() {
  A a = new A(); //# 03: compile-time error
  A a = A(); //# 04: compile-time error
  f(); //# 05: compile-time error
  g()(); //# 06: compile-time error
  new A(a: 0).m1(); //# 07: compile-time error
  new A(a: 0).m2()(); //# 08: compile-time error
}

Add a language_2 test for missing arguments related to required named parameters
Add a language_2 test for missing arguments related to required named parameters

Change-Id: I4d08c5a7d7bd7950fab001281f26f2e838335339
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100724
Reviewed-by: Paul Berry <72d414e3a99fb120308437779d51667bcc0984eb@google.com>
Commit-Queue: Brian Wilkerson <1f7641b6b14c52b9163524ab8d9aabff80176f21@google.com>
