mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:27:17 +00:00
b8ce4baf7e
Change-Id: I6576eb186149d540ce2dbc0e0aab7177ff4727be Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156484 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
25 lines
851 B
Dart
25 lines
851 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.
|
|
|
|
final int x = 'foo';
|
|
// ^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
|
|
// [cfe] A value of type 'String' can't be assigned to a variable of type 'int'.
|
|
const int y = 'foo';
|
|
// ^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.VARIABLE_TYPE_MISMATCH
|
|
// [cfe] A value of type 'String' can't be assigned to a variable of type 'int'.
|
|
// ^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
|
|
int z = 'foo';
|
|
// ^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
|
|
// [cfe] A value of type 'String' can't be assigned to a variable of type 'int'.
|
|
|
|
main() {
|
|
print(x);
|
|
print(y);
|
|
print(z);
|
|
}
|