blob: 02e2e82888168f3a8f0d8c72b7c80fdad0872158 [file] [log] [blame]
// Copyright (c) 2017, 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.
// test w/ `dart test -N unnecessary_null_aware_assignments`
class X {
m1() {
var x;
x ??= null; //LINT
x ??= 1; //OK
}
}
int? get x => null;
set x(int? x) { }
void f() {
x ??= null; //OK
}