Files
sdk/tests/language/constructor/name_test.dart
Erik Ernst 0fcdc08e60 Change language tests to avoid unintended syntax errors
The new feature 'declaring constructors' will change the syntax such
that it is an error for a non-declaring formal parameter declaration
to have the modifier `final`, and it is an error to use `var` as a
replacement for a type annotation (but the type annotation can still
be omitted entirely). This CL removes those modifiers such that the
tests will not start failing on things that aren't errors any more.

Change-Id: Ie6628f66eca696b28900759d8234b814033b4027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/456740
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2025-10-27 01:35:09 -07:00

19 lines
541 B
Dart

// Copyright (c) 2013, 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.
// Formatting can break multitests, so don't format them.
// dart format off
class Foo {
Bar.Foo(); //# 01: compile-time error
factory Bar(); //# 02: compile-time error
factory Bar.Baz(); //# 03: compile-time error
}
void main() {
new Foo();
new Foo.Foo(); //# 01: continued
new Foo.Baz(); //# 03: continued
}