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

Emit an error instead of aborting when inferring unused type parameters #766

Merged
merged 1 commit into from Aug 21, 2019

Conversation

dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Aug 16, 2019

As surfaced here, this PR makes

function test<T>(): void {
}

test();

emit an error instead of hitting an assertion, since if T is not the type of a function parameter, it has not been and cannot be inferred, and is effectively unknown inside of the function body.

@dcodeIO dcodeIO merged commit a08c7cb into master Aug 21, 2019
@MaxGraey
Copy link
Member

Is it solve this issue?

@dcodeIO
Copy link
Member Author

dcodeIO commented Aug 21, 2019

I think so. Will now emit an error if test() is called without T.

@MaxGraey
Copy link
Member

Great!

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

Successfully merging this pull request may close these issues.

None yet

2 participants