245105300c
Change-Id: I260150562d253f480f70f04b7038fc7bcdadca26 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501764 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
29 lines
830 B
Dart
29 lines
830 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.
|
|
|
|
import 'package:test_reflective_loader/test_reflective_loader.dart';
|
|
|
|
import '../dart/resolution/context_collection_resolution.dart';
|
|
import '../dart/resolution/node_text_expectations.dart';
|
|
|
|
main() {
|
|
defineReflectiveSuite(() {
|
|
defineReflectiveTests(AssignmentToFunctionTest);
|
|
defineReflectiveTests(UpdateNodeTextExpectations);
|
|
});
|
|
}
|
|
|
|
@reflectiveTest
|
|
class AssignmentToFunctionTest extends PubPackageResolutionTest {
|
|
test_function() async {
|
|
await resolveTestCodeWithDiagnostics(r'''
|
|
f() {}
|
|
main() {
|
|
f = null;
|
|
//^
|
|
// [diag.assignmentToFunction] Functions can't be assigned a value.
|
|
}''');
|
|
}
|
|
}
|