f20b0ddcc2
Closes https://github.com/dart-lang/sdk/issues/43022 Real static errors were added in a previous CL. This simply removes TODOs to address that and removes a TODO to handle contexts. Static error testing doesn't support testing for contexts. Change-Id: Id27fadeb77484a3556fdfdf4c50c8cd67ce2d9a0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159381 Auto-Submit: Srujan Gaddam <srujzs@google.com> Commit-Queue: Srujan Gaddam <srujzs@google.com> Commit-Queue: Nate Bosch <nbosch@google.com> Reviewed-by: Nate Bosch <nbosch@google.com>
62 lines
2.5 KiB
Dart
62 lines
2.5 KiB
Dart
// 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.
|
|
|
|
// Checks for static errors related to parameters for methods.
|
|
|
|
@JS()
|
|
library js_parameters_static_test;
|
|
|
|
import 'package:js/js.dart';
|
|
import 'package:expect/expect.dart';
|
|
|
|
@JS()
|
|
class Foo {
|
|
external int singleNamedArg({int? a});
|
|
// ^
|
|
// [web] Named parameters for JS interop functions are only allowed in a factory constructor of an @anonymous JS class.
|
|
external int mixedNamedArgs(int a, {int? b});
|
|
// ^
|
|
// [web] Named parameters for JS interop functions are only allowed in a factory constructor of an @anonymous JS class.
|
|
}
|
|
|
|
@JS()
|
|
class Bar {
|
|
external static int singleNamedArg({int? a});
|
|
// ^
|
|
// [web] Named parameters for JS interop functions are only allowed in a factory constructor of an @anonymous JS class.
|
|
external static int mixedNamedArgs(int a, {int? b});
|
|
// ^
|
|
// [web] Named parameters for JS interop functions are only allowed in a factory constructor of an @anonymous JS class.
|
|
}
|
|
|
|
external int singleNamedArg({int? a});
|
|
// ^
|
|
// [web] Named parameters for JS interop functions are only allowed in a factory constructor of an @anonymous JS class.
|
|
external int mixedNamedArgs(int a, {int? b});
|
|
// ^
|
|
// [web] Named parameters for JS interop functions are only allowed in a factory constructor of an @anonymous JS class.
|
|
|
|
@JS()
|
|
@anonymous
|
|
class Baz {
|
|
external int singleNamedArg({int? a});
|
|
// ^
|
|
// [web] Named parameters for JS interop functions are only allowed in a factory constructor of an @anonymous JS class.
|
|
external int mixedNamedArgs(int a, {int? b});
|
|
// ^
|
|
// [web] Named parameters for JS interop functions are only allowed in a factory constructor of an @anonymous JS class.
|
|
}
|
|
|
|
@JS()
|
|
abstract class Qux {
|
|
external int singleNamedArg({int? a});
|
|
// ^
|
|
// [web] Named parameters for JS interop functions are only allowed in a factory constructor of an @anonymous JS class.
|
|
external int mixedNamedArgs(int a, {int? b});
|
|
// ^
|
|
// [web] Named parameters for JS interop functions are only allowed in a factory constructor of an @anonymous JS class.
|
|
}
|
|
|
|
main() {}
|