-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
dart --version: Dart SDK version: 3.10.0-247.0.dev (dev) (Thu Sep 25 13:09:08 2025 -0700) on "macos_x64"
Simple repro
final class AliasUser
{ Void operator []=(Object key, Object value){}
}
typedef Void=void;The compiler emits the following error
main.dart:2:3: Error: The return type of the operator []= must be 'void'.
Try changing the return type to 'void'.
{ Void operator []=(Object key, Object value){}
^
I believe an alias of void should be acceptable as the return-type annotation for []=. Static analysis via VSCode does not report a warning. Only the compiler does.
Metadata
Metadata
Assignees
Labels
area-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)