-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
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.model-flowImplementation of flow analysis in analyzer/cfeImplementation of flow analysis in analyzer/cfetype-questionA question about expected behavior or functionalityA question about expected behavior or functionality
Description
@stereotype441, please help me to figure out if the below is an issue or an expected behavior? Shouldn't s
be promoted to T
in this case?
class S {}
class T extends S {
int answer() => 42;
}
main() {
S s = S();
try {
if (s is T) {} // make `T` a type of interest
} on Exception catch (_) {
s = T();
s.answer(); // Error. The method 'answer' isn't defined for the type 'S'
}
}
Dart SDK version: 3.8.0-278.0.dev (dev) (Mon Apr 7 17:08:37 2025 -0700) on "windows_x64"
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.model-flowImplementation of flow analysis in analyzer/cfeImplementation of flow analysis in analyzer/cfetype-questionA question about expected behavior or functionalityA question about expected behavior or functionality