Skip to content

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