import 'dart:collection';
main() {
List<int> values;
// Queues are optimized for adding to the head or tail
// Items cannot be accessed by their index.
var q = new Queue.from([300, 200, 100, 500]);
//var y;
// Queues implement Iterable:
print(q.takeWhile((i) => i > 100));
kgjrhru('x',x);
// Consuming a queue
while(q.first > 100) {
q.removeFirst();
}
print(q);
if (values !=null) {
print(values.length);
}
}
字符串 执行dart analyse test.dart,得到:
PS D:\TEMP> dart analyze test.dart
Analyzing test.dart...
error • test.dart:12:3 • The function 'kgjrhru' isn't defined. Try importing the library that defines 'kgjrhru', correcting
the name to the name of an existing function, or defining a function named 'kgjrhru'. • undefined_function
error • test.dart:12:15 • Undefined name 'x'. Try correcting the name to one that is defined, or defining the name. •
undefined_identifier
error • test.dart:20:7 • The non-nullable local variable 'values' must be assigned before it can be used. Try giving it an
initializer expression, or ensure that it's assigned on every execution path. •
not_assigned_potentially_non_nullable_local_variable
error • test.dart:21:11 • The non-nullable local variable 'values' must be assigned before it can be used. Try giving it an
initializer expression, or ensure that it's assigned on every execution path. •
not_assigned_potentially_non_nullable_local_variable
warning • test.dart:20:7 • The operand can't be null, so the condition is always 'false'. Try removing the condition, an
enclosing condition, or the whole conditional statement. • unnecessary_null_comparison
warning • test.dart:20:14 • The operand can't be null, so the condition is always 'true'. Remove the condition. •
unnecessary_null_comparison
6 issues found.
PS D:\TEMP>
1条答案
按热度按时间vsikbqxv1#
使用此代码:
字符串
执行
dart analyse test.dart
,得到:型
VS代码仍然显示
6
,而不是类似于4,2
:的代码