blob: 1d753cf7d4da088a42c6e68c40129014b86c68a0 [file] [log] [blame]
// Copyright (c) 2016, 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.
// @dart=2.9
// test w/ `dart test -N avoid_init_to_null`
var x = null; //LINT
var y; //OK
var z = 1; //OK
const nil = null; //OK
final nil2 = null; //OK
foo({p: null}) {} //LINT
class X {
static const nil = null; //OK
final nil2 = null; //OK
int x = null; //LINT
int y; //OK
int z;
X({int a: null}); //LINT
X.b({this.z: null}); //LINT
fooNamed({
p: null, //LINT
p1 = null, //LINT
var p2 = null, //LINT
p3 = 1, //OK
p4, //OK
}) {}
fooOptional([
p = null, //LINT
p1 = null, //LINT
var p2 = null, //LINT
p3 = 1, //OK
p4, //OK
]) {}
}