-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).Dart language related items (some items might be better tracked at github.com/dart-lang/language).type-questionA question about expected behavior or functionalityA question about expected behavior or functionality
Description
class C {}
class D {}
main() {
Object o = C();
if (o is C) {} // No warning
o = C();
if (o is C) {} // unnecessary_type_check warning.
o = D();
if (o is D) {} // No warning
if (o is D) {} // No warning
o = D();
if (o is D) {} // unnecessary_type_check warning.
}Why there is no warning after the first assignment of the new object instance?
Dart SDK version: 3.7.0-183.0.dev (dev) (Fri Nov 22 20:03:46 2024 -0800) on "windows_x64"
Metadata
Metadata
Assignees
Labels
area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).Dart language related items (some items might be better tracked at github.com/dart-lang/language).type-questionA question about expected behavior or functionalityA question about expected behavior or functionality