Skip to content

fix: remove the parameter number limit for functionType infer #2434

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

Merged

Conversation

HerrCai0907
Copy link
Member

fix error report of code:

function foo<T>(fn: () => T): void {
  trace(nameof<T>());
}
foo((): string => ""); // Type argument expected.
  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@HerrCai0907 HerrCai0907 force-pushed the fix/propagateInferredGenericTypes branch from 9cec718 to 1a35988 Compare August 12, 2022 09:18
@HerrCai0907 HerrCai0907 requested a review from MaxGraey August 12, 2022 23:59
@HerrCai0907 HerrCai0907 requested a review from dcodeIO August 17, 2022 02:32
@dcodeIO
Copy link
Member

dcodeIO commented Aug 20, 2022

Can you explain in a few sentences what this change does exactly? I'm probably just missing it, but I'm not quite seeing which limit was removed.

@HerrCai0907
Copy link
Member Author

HerrCai0907 commented Aug 21, 2022

@dcodeIO limit is parameterTypes.length == parameterNodes.length. But actually function can receive a callback which parameter count less than signature parameter count. So this limit can be removed.

@MaxGraey
Copy link
Member

Please resolve fixture's conflict

@MaxGraey MaxGraey merged commit a20c005 into AssemblyScript:main Aug 21, 2022
@MaxGraey
Copy link
Member

Thanks!

@HerrCai0907 HerrCai0907 deleted the fix/propagateInferredGenericTypes branch August 21, 2022 02:33
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.

3 participants