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

dart2js: `main` receives an argument which is not a `List<String>` #36627

Open
eernstg opened this Issue Apr 15, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@eernstg
Copy link
Member

eernstg commented Apr 15, 2019

Cf. dart-lang/dart-pad#1009, dart2js generated programs invoke the main function of a script with an argument which is not of type List<String>.

main(args) {
  print(args is List<String>); // Prints 'false'.
}

The specification requires that it is a List<String>, here, and this would also be a reasonable choice in practice.

With a declared type (main(List<String> args)) the execution actually throws already before the body of main starts execution, i.e., the argument type is subject to a dynamic type check. This would not be necessary in a situation where the provided argument has been created by platform code and is already known to have type List<String>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.