mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:19:48 +00:00
Migrate "g" - "i" directory language tests off @compile-error.
The "@compile-error" comment is an old not-great way of defining static error tests. See: https://github.com/dart-lang/sdk/issues/45634 Change-Id: I65c446e00b25239960d421489e6cf87a88d875d5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296408 Reviewed-by: Nate Bosch <nbosch@google.com> Commit-Queue: Nate Bosch <nbosch@google.com> Auto-Submit: Bob Nystrom <rnystrom@google.com> Commit-Queue: Bob Nystrom <rnystrom@google.com>
This commit is contained in:
parent
1d718fc7e9
commit
c305279e0d
|
@ -6,9 +6,15 @@
|
|||
// There is an interface conflict here due to a loop in the class
|
||||
// hierarchy leading to an infinite set of implemented types; this loop
|
||||
// shouldn't cause non-termination.
|
||||
/*@compile-error=unspecified*/ class A<T> implements B<List<T>> {}
|
||||
class A<T> implements B<List<T>> {}
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
||||
// [cfe] 'A' is a supertype of itself.
|
||||
|
||||
/*@compile-error=unspecified*/ class B<T> implements A<List<T>> {}
|
||||
class B<T> implements A<List<T>> {}
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
||||
// [cfe] 'B' is a supertype of itself.
|
||||
|
||||
main() {
|
||||
new A();
|
||||
|
|
|
@ -6,9 +6,15 @@
|
|||
// There is no interface conflict here, but there is a loop in the class
|
||||
// hierarchy leading to a finite set of implemented types; this loop
|
||||
// shouldn't cause non-termination.
|
||||
/*@compile-error=unspecified*/ class A<T> implements B<T> {}
|
||||
class A<T> implements B<T> {}
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
||||
// [cfe] 'A' is a supertype of itself.
|
||||
|
||||
/*@compile-error=unspecified*/ class B<T> implements A<T> {}
|
||||
class B<T> implements A<T> {}
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
||||
// [cfe] 'B' is a supertype of itself.
|
||||
|
||||
main() {
|
||||
new A();
|
||||
|
|
|
@ -9,7 +9,10 @@ class A implements I<int> {}
|
|||
|
||||
class B implements I<String> {}
|
||||
|
||||
/*@compile-error=unspecified*/ class C extends A implements B {}
|
||||
class C extends A implements B {}
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_GENERIC_INTERFACES
|
||||
// [cfe] 'C' can't implement both 'I<int>' and 'I<String>'
|
||||
|
||||
main() {
|
||||
new C();
|
||||
|
|
|
@ -6,7 +6,10 @@
|
|||
class A {
|
||||
const A();
|
||||
foo() {
|
||||
return y; /*@compile-error=unspecified*/
|
||||
return y;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
|
||||
// [cfe] The getter 'y' isn't defined for the class 'A'.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,5 +9,8 @@ import 'dart:typed_data';
|
|||
import 'package:expect/expect.dart';
|
||||
|
||||
main() {
|
||||
ClassID.GetID(4); /*@compile-error=unspecified*/
|
||||
ClassID.GetID(4);
|
||||
//^^^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
|
||||
// [cfe] Undefined name 'ClassID'.
|
||||
}
|
||||
|
|
|
@ -2,8 +2,13 @@
|
|||
// 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.
|
||||
|
||||
var /*@compile-error=unspecified*/ x = () => y;
|
||||
var /*@compile-error=unspecified*/ y = () => x;
|
||||
var x = () => y;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.TOP_LEVEL_CYCLE
|
||||
// [cfe] Can't infer the type of 'x': circularity found during type inference.
|
||||
var y = () => x;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.TOP_LEVEL_CYCLE
|
||||
|
||||
void main() {
|
||||
x;
|
||||
|
|
|
@ -10,7 +10,10 @@ class A {
|
|||
// initializing formal.
|
||||
A(this.x)
|
||||
: y = (() {
|
||||
/*@compile-error=unspecified*/ x = 3;
|
||||
x = 3;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
|
||||
// [cfe] Can't assign to the final variable 'x'.
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -8,9 +8,15 @@
|
|||
// There is an interface conflict here due to a loop in the class
|
||||
// hierarchy leading to an infinite set of implemented types; this loop
|
||||
// shouldn't cause non-termination.
|
||||
/*@compile-error=unspecified*/ class A<T> implements B<List<T>> {}
|
||||
class A<T> implements B<List<T>> {}
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
||||
// [cfe] 'A' is a supertype of itself.
|
||||
|
||||
/*@compile-error=unspecified*/ class B<T> implements A<List<T>> {}
|
||||
class B<T> implements A<List<T>> {}
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
||||
// [cfe] 'B' is a supertype of itself.
|
||||
|
||||
main() {
|
||||
new A();
|
||||
|
|
|
@ -8,9 +8,15 @@
|
|||
// There is no interface conflict here, but there is a loop in the class
|
||||
// hierarchy leading to a finite set of implemented types; this loop
|
||||
// shouldn't cause non-termination.
|
||||
/*@compile-error=unspecified*/ class A<T> implements B<T> {}
|
||||
class A<T> implements B<T> {}
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
||||
// [cfe] 'A' is a supertype of itself.
|
||||
|
||||
/*@compile-error=unspecified*/ class B<T> implements A<T> {}
|
||||
class B<T> implements A<T> {}
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
||||
// [cfe] 'B' is a supertype of itself.
|
||||
|
||||
main() {
|
||||
new A();
|
||||
|
|
|
@ -11,7 +11,10 @@ class A implements I<int> {}
|
|||
|
||||
class B implements I<String> {}
|
||||
|
||||
/*@compile-error=unspecified*/ class C extends A implements B {}
|
||||
class C extends A implements B {}
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_GENERIC_INTERFACES
|
||||
// [cfe] 'C' can't implement both 'I<int>' and 'I<String>'
|
||||
|
||||
main() {
|
||||
new C();
|
||||
|
|
|
@ -8,7 +8,10 @@
|
|||
class A {
|
||||
const A();
|
||||
foo() {
|
||||
return y; /*@compile-error=unspecified*/
|
||||
return y;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
|
||||
// [cfe] The getter 'y' isn't defined for the class 'A'.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,5 +11,8 @@ import 'dart:typed_data';
|
|||
import 'package:expect/expect.dart';
|
||||
|
||||
main() {
|
||||
ClassID.GetID(4); /*@compile-error=unspecified*/
|
||||
ClassID.GetID(4);
|
||||
//^^^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
|
||||
// [cfe] Undefined name 'ClassID'.
|
||||
}
|
||||
|
|
|
@ -4,8 +4,13 @@
|
|||
|
||||
// @dart = 2.9
|
||||
|
||||
var /*@compile-error=unspecified*/ x = () => y;
|
||||
var /*@compile-error=unspecified*/ y = () => x;
|
||||
var x = () => y;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.TOP_LEVEL_CYCLE
|
||||
// [cfe] Can't infer the type of 'x': circularity found during type inference.
|
||||
var y = () => x;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.TOP_LEVEL_CYCLE
|
||||
|
||||
void main() {
|
||||
x;
|
||||
|
|
|
@ -12,7 +12,10 @@ class A {
|
|||
// initializing formal.
|
||||
A(this.x)
|
||||
: y = (() {
|
||||
/*@compile-error=unspecified*/ x = 3;
|
||||
x = 3;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL
|
||||
// [cfe] Can't assign to the final variable 'x'.
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,10 @@ class A {
|
|||
// Finding the type of an initializing formal: should cause an error
|
||||
// in the initializer but not the body, because the former has type
|
||||
// `int` and the latter has type `num`.
|
||||
A(int this.x) : /*@compile-error=unspecified*/ y = x {
|
||||
A(int this.x) : y = x {
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
|
||||
// [cfe] A value of type 'int' can't be assigned to a variable of type 'double'.
|
||||
y = x;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
int v = null;
|
||||
void test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] Can't return a value from a void function.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Object v = null;
|
||||
void test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] Can't return a value from a void function.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<int> v = null;
|
||||
void test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] Can't return a value from a void function.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<int> v = null;
|
||||
void test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] Can't return a value from a void function.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<Object> v = null;
|
||||
void test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] Can't return a value from a void function.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<Object> v = null;
|
||||
void test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] Can't return a value from a void function.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
void v = null;
|
||||
Object test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<void> v = null;
|
||||
Object test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<void> v = null;
|
||||
Object test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
void v = null;
|
||||
Future<int> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<void> v = null;
|
||||
Future<int> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<void> v = null;
|
||||
Future<int> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
void v = null;
|
||||
FutureOr<int> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<void> v = null;
|
||||
FutureOr<int> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<void> v = null;
|
||||
FutureOr<int> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
void v = null;
|
||||
Future<Object> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<void> v = null;
|
||||
Future<Object> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<void> v = null;
|
||||
Future<Object> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
void v = null;
|
||||
FutureOr<Object> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<void> v = null;
|
||||
FutureOr<Object> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<void> v = null;
|
||||
FutureOr<Object> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
int v = null;
|
||||
Future<String> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'Future<int>' can't be assigned to a variable of type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<int> v = null;
|
||||
Future<String> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'Future<int>' can't be assigned to a variable of type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<int> v = null;
|
||||
Future<String> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'Future<int>' can't be assigned to a variable of type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<Future<String>> v = null;
|
||||
Future<String> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'Future<Future<String>>' can't be assigned to a variable of type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
int v = null;
|
||||
FutureOr<String> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'Future<int>' can't be assigned to a variable of type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<int> v = null;
|
||||
FutureOr<String> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'Future<int>' can't be assigned to a variable of type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<int> v = null;
|
||||
FutureOr<String> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'Future<int>' can't be assigned to a variable of type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<Future<String>> v = null;
|
||||
FutureOr<String> test() async {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'Future<Future<String>>' can't be assigned to a variable of type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
int v = null;
|
||||
void test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] Can't return a value from a void function.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Object v = null;
|
||||
void test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] Can't return a value from a void function.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<int> v = null;
|
||||
void test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] Can't return a value from a void function.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<int> v = null;
|
||||
void test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] Can't return a value from a void function.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<Object> v = null;
|
||||
void test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] Can't return a value from a void function.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<Object> v = null;
|
||||
void test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] Can't return a value from a void function.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
void v = null;
|
||||
int test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
void v = null;
|
||||
Object test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
void v = null;
|
||||
Future<int> test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
void v = null;
|
||||
FutureOr<int> test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
void v = null;
|
||||
Future<Object> test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
void v = null;
|
||||
FutureOr<Object> test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] This expression has type 'void' and can't be used.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
int v = null;
|
||||
String test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'int' can't be assigned to a variable of type 'String'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<int> v = null;
|
||||
String test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'Future<int>' can't be assigned to a variable of type 'String'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<int> v = null;
|
||||
String test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'FutureOr<int>' can't be assigned to a variable of type 'String'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
int v = null;
|
||||
Future<String> test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'int' can't be assigned to a variable of type 'Future<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<int> v = null;
|
||||
Future<String> test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'Future<int>' can't be assigned to a variable of type 'Future<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<int> v = null;
|
||||
Future<String> test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'FutureOr<int>' can't be assigned to a variable of type 'Future<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
int v = null;
|
||||
FutureOr<String> test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'int' can't be assigned to a variable of type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
Future<int> v = null;
|
||||
FutureOr<String> test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'Future<int>' can't be assigned to a variable of type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,10 @@ import 'dart:async';
|
|||
*/
|
||||
FutureOr<int> v = null;
|
||||
FutureOr<String> test() {
|
||||
return /*@compile-error=unspecified*/ v;
|
||||
return v;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE
|
||||
// [cfe] A value of type 'FutureOr<int>' can't be assigned to a variable of type 'FutureOr<String>'.
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
Loading…
Reference in a new issue