You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's probably an artifact from the translation from C#, but popFunc doesn't actually ensure that it pops an instruction. popType<T> uses this.pop() as T which is just a cast (assertion) in Typescript. So I think this error will never occur.
This pattern:
functionf<T>(): T{returnwhateverasT;}
Is not useful in Typescript and is misleading when coming from C#, because it's basically just a cast. I'd recommend replacing popType with this.pop() as T.
The text was updated successfully, but these errors were encountered:
It's probably an artifact from the translation from C#, but
popFunc
doesn't actually ensure that it pops an instruction.popType<T>
usesthis.pop() as T
which is just a cast (assertion) in Typescript. So I think this error will never occur.This pattern:
Is not useful in Typescript and is misleading when coming from C#, because it's basically just a cast. I'd recommend replacing
popType
withthis.pop() as T
.The text was updated successfully, but these errors were encountered: