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

Invocation of values of type constructor{?} allowed without argument checking #2279

Open
mor-n4 opened this issue Dec 2, 2021 · 0 comments
Labels

Comments

@mor-n4
Copy link
Contributor

mor-n4 commented Dec 2, 2021

Values of type Function can be invoked with call expressions and no checking of arguments and their types will be performed:

let fn: Function;
fn(); // no error
fn("", 42); // no error

However, this behavior is also applied to values of type constructor{?} (and for consistency also to values of a type that contains a construct signature without a call signature), which is probably(!) not desired:

let ctor: constructor{?};
ctor(); // no error
ctor("hello", 42); // no error

This should be reconsidered!

Also check tests in file CallConstructSignature_usage1.n4js.xt (search for **) and search the code base for TODO GH-2279.

@mor-n4 mor-n4 added the bug label Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant