assemblyscript
assemblyscript copied to clipboard
Upcast and downcast are switched
Hi! Thanks for building AssemblyScript! I noticed that "upcast" and "downcast" are switched:
https://github.com/AssemblyScript/assemblyscript/blob/53af0e02113f0c4cd84947465a8c5064d3a82786/src/compiler.ts#L3472-L3501
"Upcast" should be the straightforward, static case whereas "downcast" should be dynamic and more complex. No logic changes are needed, just the words need to be switched, especially in the error message below:
https://github.com/AssemblyScript/assemblyscript/blob/53af0e02113f0c4cd84947465a8c5064d3a82786/src/compiler.ts#L10564
For context, that error message was pointed out to be wrong in https://github.com/LimeChain/demo-subgraph/pull/39.
I created a PR to fix this issue: https://github.com/AssemblyScript/assemblyscript/pull/2423.
Looks like managed-cast
test still fail