Skip to content
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

Using .call to call a function is not checked in strong mode #27098

Closed
leafpetersen opened this issue Aug 17, 2016 · 4 comments
Closed

Using .call to call a function is not checked in strong mode #27098

leafpetersen opened this issue Aug 17, 2016 · 4 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on
Milestone

Comments

@leafpetersen
Copy link
Member

This code has no errors in strong mode:

typedef bool Predicate<T>(T object);
Predicate<String> f() => null;
void main() {
  String x = (f()).call(3);
}
@leafpetersen leafpetersen added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-strong-mode labels Aug 17, 2016
@jmesserly
Copy link

jmesserly commented Aug 17, 2016

edit: i'm less sure now, other than that element_resovler code is a mess :(

yeah that's because of parens possibly? FunctionInvocationExpression was not fixed, only MethodInvocation. Tear offs of call methods (if that's legal) have the same problem. Also probably here we lose the function type result because it's all Element based instead of using the FunctionType

@jmesserly jmesserly added the P2 A bug or feature request we're likely to work on label Aug 17, 2016
@jmesserly
Copy link

jmesserly commented Aug 17, 2016

related to #27050, and #26812 was the fix for methodinvocation

@MichaelRFairhurst
Copy link
Contributor

@stereotype441 was this something you had worked on or would it be useful if I took a look?

@scheglov
Copy link
Contributor

dart-bot pushed a commit that referenced this issue Apr 20, 2018
R=brianwilkerson@google.com

Bug: #27098
Change-Id: I0d5ac65202b632646bd7b26170c55ab985d2523c
Reviewed-on: https://dart-review.googlesource.com/52263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

5 participants