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

frog is not giving static type error when attempting to call non-function #490

Closed
DartBot opened this issue Nov 17, 2011 · 4 comments
Closed

Comments

@DartBot
Copy link

DartBot commented Nov 17, 2011

This issue was originally filed by [email protected]


This is giving no static errors or warnings in frog:

main() {
  print("hello");
  int num = 5;
  num(); // should be a warning or error here, since num is not a function
  print("done");
}

(I hit this because there are properties in the DOM which return things like a CanvasElement, and it's not obvious it's a property, so I have extra parentheses, so it would be good if the static checker could catch that.)

@DartBot
Copy link
Author

DartBot commented Nov 17, 2011

This comment was originally written by [email protected]


Actually, here is a better example (just wanted to remove 'num', since this issue has nothing to do with the num keyword):

main() {
  print("hello");
  int n = 5;
  n(); // should be a warning or error here, since n is not a function
  print("done");
}

@jmesserly
Copy link

Added Triaged label.

@DartBot
Copy link
Author

DartBot commented Nov 19, 2011

This comment was originally written by [email protected]


Added Started label.

@DartBot
Copy link
Author

DartBot commented Nov 19, 2011

This comment was originally written by [email protected]


http://codereview.chromium.org/8536056/

Needs a test once testing infrastructure supports precise warning levels and line numbers.


Added Fixed label.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants