assemblyscript
assemblyscript copied to clipboard
Implement inner type aliases
Example:
function foo<TArr extends ArrayLike<number>>(arr: TArr): valueof<TArr> {
type T = valueof<TArr>; // doesn't work yet "ERROR AS100: Not implemented: Inner type alias"
let element: T = arr[0];
return element;
}
Wouldn't the return value be T
, not valueof<T>
?
It should be valueof<TArr>
becouse T
defined in foo
scope and doesn't visible globally.
See typescript playground
Got it. I'm going to give this a try, but I probably won't succeed.