Skip to content

Conversation

@MaxGraey
Copy link
Member

@MaxGraey MaxGraey commented Nov 7, 2019

Relate to #938

@dcodeIO
Copy link
Member

dcodeIO commented Nov 7, 2019

Considering that the implementation isn't generic, wouldn't it be straight-forward to model the declaration exactly like that by adding one .wrap to each subclass with a concrete return type? Would otherwise imagine that someone could try to use it as a generic function with unexpected results.

@MaxGraey
Copy link
Member Author

MaxGraey commented Nov 7, 2019

I simplified this. I guess this completely solved issue

@MaxGraey
Copy link
Member Author

MaxGraey commented Nov 7, 2019

Considering that the implementation isn't generic, wouldn't it be straight-forward to model the declaration exactly like that by adding one .wrap to each subclass with a concrete return type?

What about this?

static wrap<_T = TypedArray<number>>(this: Constructor<_T>, ...): _T;

@MaxGraey MaxGraey requested a review from dcodeIO November 16, 2019 14:10
@dcodeIO dcodeIO merged commit b2bb264 into AssemblyScript:master Nov 16, 2019
@dcodeIO
Copy link
Member

dcodeIO commented Nov 16, 2019

That's ideal, thanks! :)

@MaxGraey MaxGraey deleted the fix-typedarray-wrap-def branch November 16, 2019 14:17
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.

2 participants