Files
sdk/tests/language/assign/top_method_error_test.dart
T
Robert Nystrom 96d18bae05 Reformat tests/language/assign/.
Change-Id: I3be46d802ac851b4fca7ddf4100b04f8d4a38f9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399880
Reviewed-by: Alexander Aprelev <aam@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2024-12-13 10:52:25 -08:00

20 lines
509 B
Dart

// Copyright (c) 2012, 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.
import "package:expect/expect.dart";
method() {
return 0;
}
main() {
// Illegal, can't change a top level method.
method = () {
// [error column 3, length 6]
// [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FUNCTION
// [cfe] Setter not found: 'method'.
return 1;
};
}