-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analyzer: Improperly failed inference with promoted type parameters #35799
Comments
Note: there is a test in the analyzer codebase that should be re-enabled when this bug is fixed: https://dart-review.googlesource.com/c/sdk/+/90880/4/pkg/analyzer/test/src/task/strong/checker_test.dart#3989 |
I'm not convinced that this issue should be considered as a bug in the analyzer, it is probably about the type inference algorithm. I created dart-lang/language#3009 for that. |
@FMorschel, thanks for looking into those potential connections! I do think there is a connection between #52117 and #52077 and #56028, they are all about extensions and intersection types. However, there is probably no connection to this issue, where the topic is F-bounded type variables and inference (with no references to intersection types or extensions at all). |
No problem, it is not always easy to see whether or not there is a connection! |
Here, the call to f should be valid and inferrable as
Cloneable<T>
.However it fails in analyzer and CFE. This is the analyzer ticket for this issue. (CFE is #35800)
It's critical to note that
object
is promoted to typeT' extends SubCloneable<T>
. So if the analyzer attempts to inferSubClonable<T>
forT
inf(object)
, then that will fail. However, it should be possible to infer Clonable, which in fact works when typed explicitly.May be related to #35100
The text was updated successfully, but these errors were encountered: