-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P1A high priority bug; for example, a single project is unusable or has many test failuresA high priority bug; for example, a single project is unusable or has many test failuresdevexp-warningIssues with the analyzer's Warning codesIssues with the analyzer's Warning codesfeature-extension-typesImplementation of the extension type featureImplementation of the extension type featurelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.
Description
The code below works well at run time but produces a wrong warning in the analyzer
// SharedOptions=--enable-experiment=inline-class
import "../../Utils/expect.dart";
extension type BoolET(bool _) {}
String test(BoolET o) {
switch (o) {
case BoolET _b: // warning • The matched value type 'BoolET' can never match the required type 'BoolET'.
// Try using a different pattern.
return "exhaustive";
}
}
main() {
Expect.equals("exhaustive", test(BoolET(true)));
}
Tested on Dart SDK version: 3.4.0-edge.bcfab01e878682e268d935c5a866fd6cb854541e (main) (Wed Jan 10 02:10:36 2024 +0000) on "linux_x64"
Metadata
Metadata
Assignees
Labels
P1A high priority bug; for example, a single project is unusable or has many test failuresA high priority bug; for example, a single project is unusable or has many test failuresdevexp-warningIssues with the analyzer's Warning codesIssues with the analyzer's Warning codesfeature-extension-typesImplementation of the extension type featureImplementation of the extension type featurelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.