dc34c02329
Closes https://github.com/flutter/flutter/issues/161479 Change-Id: I6657e93dc609566fb5c11d85918e37e2da8744d4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448861 Reviewed-by: Paul Berry <paulberry@google.com>
34 lines
1.0 KiB
Dart
34 lines
1.0 KiB
Dart
// Copyright (c) 2025, 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.
|
|
|
|
abstract class A {
|
|
Function get fooFunction;
|
|
dynamic get fooDynamic;
|
|
void fooRegular(Object? arg);
|
|
Never get fooNever;
|
|
|
|
void bar() {}
|
|
|
|
test() {
|
|
fooFunction(bar());
|
|
// ^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
|
|
// [cfe] This expression has type 'void' and can't be used.
|
|
fooDynamic(bar());
|
|
// ^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
|
|
// [cfe] This expression has type 'void' and can't be used.
|
|
fooRegular(bar());
|
|
// ^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
|
|
// [cfe] This expression has type 'void' and can't be used.
|
|
fooNever(bar());
|
|
// ^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
|
|
// [cfe] This expression has type 'void' and can't be used.
|
|
}
|
|
}
|
|
|
|
void main() {}
|