Skip to content

Explicitly restrict exporting generic functions for entry file #570

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

Closed
MaxGraey opened this issue Apr 6, 2019 · 2 comments · Fixed by #1305
Closed

Explicitly restrict exporting generic functions for entry file #570

MaxGraey opened this issue Apr 6, 2019 · 2 comments · Fixed by #1305

Comments

@MaxGraey
Copy link
Member

MaxGraey commented Apr 6, 2019

main.ts:

export function foo<T>(a: T): T {
  return a;
}

Currently generate wasm module without foo function.
Expected: should be compiler error about exporting generic functions/classes are not allowing.

@MaxGraey MaxGraey changed the title Explicetly restrict export generic functions for entry file Explicitly restrict exporting generic functions for entry file Apr 6, 2019
@dcodeIO
Copy link
Member

dcodeIO commented Apr 6, 2019

What currently happens is, if a concrete instance of it, let's say foo<i32>, is used and thus compiled somewhere in the module, it becomes exported. Not sure if that's useful or not. Restricting generic exports makes sense to me as well.

@MaxGraey
Copy link
Member Author

MaxGraey commented Apr 6, 2019

Yeah. May be not restrict as error but print warning. Hmm...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants