blob: f715e5fa7da0c2d787ac2b7a0ce426110eb6554e [file] [log] [blame]
// 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.
// This version should continue to opt in to null safety in purpetuity (or at
// least until Dart 3), when the experiment is enabled.
// @dart = 2.10
void main() {
// This should be an error since we are opted in.
int x = null;
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
// [cfe] A value of type 'Null' can't be assigned to a variable of type 'int'.
}