Open
Description
import 'dart:collection';
void main() {
['Hi', '', 'Hello'].map(FullString.fromOr).nonNulls; // The getter 'nonNulls' isn't defined for the type...
<String?>['Hi', '', 'Hello'].nonNulls; // works as expected
}
extension type FullString._(String value) {
static FullString? fromOr(String value) {
if (value.isEmpty) return null;
return FullString._(value);
}
}
Invoking dart analyze main.dart
produces the above error. However, I cannot reproduce this using dartpad so it might be something wrong with my installation.
Dart version: Dart SDK version: 3.8.1 (stable) (Wed May 28 00:47:25 2025 -0700) on "macos_arm64"