-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Generic function types used as variable declarations are misinterpreted #29237
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
Comments
My guess for this bug and #29236 is that the "typedef Foo" is not creating a FunctionTypeImpl that is generic (type.typeFormals.isNotEmpty). It's possible it's being treated as equivalent to |
Should this be 1.23 @kevmoo ? |
My take is that this is pretty much the core of analyzer support for generic function types, so either we push the feature off, or this bug is 1.23. Marking it 1.23 now, since the feature is currently still marked 1.23. |
@bwilkerson can you please take a look ASAP? |
I think Brian is out, I'm taking a look now to see if I can make some progress on it. |
Awesome! Let me know if I can help at all. |
I think this is still broken for return types and fields (at least). typedef Foo = int Function<T>(T x);
int foo<T>(T x) => 3;
Foo bar() => foo;
void test1() {
bar()<String>("hello");
}
class A {
Foo f;
void test() {
f<String>("hello");
}
}
|
…r resynthesizing. This is based on your CL https://codereview.chromium.org/2808093004/ and includes fixes for summarization and resynthesis. [email protected] BUG= #29237 Review-Url: https://codereview.chromium.org/2814443005 .
I think this CL landed so we can close the bug out ... feel free to reopen if there's more to it! |
@scheglov, does your commit still need to be merged into 1.23 stable? |
It does, but that's not the end yet :-( |
I found one in DDC too, so you're not alone :) |
@jmesserly Just FYI: there was a commit this morning that fixed the last known problem in the parser. That might well have caused follow-on issues in DDC, so you should re-test. The summary work that Konstantin is doing might also be causing problems for DDC, so you might need to wait for his work before you can be sure of the status of DDC. |
…r resynthesizing. This is based on your CL https://codereview.chromium.org/2808093004/ and includes fixes for summarization and resynthesis. [email protected] BUG= #29237 Review-Url: https://codereview.chromium.org/2814443005 .
The code below should have no errors, but on bleeding edge shows an error on the call to
y
.It looks to me as if perhaps the variable declaration
Foo y
is being interpreted as declaringy
to have typeT -> int
withT
unbound, instead of<T>(T) -> int
.The text was updated successfully, but these errors were encountered: