acuarica / evm

A Symbolic Ethereum Virtual Machine (EVM) bytecode interpreter, parser and decompiler, along with several other utils for programmatically extracting information from EVM bytecode.
https://acuarica.github.io/evm/
MIT License
62 stars 9 forks source link

Fix `.d.ts` typecheck errors #35

Closed acuarica closed 8 months ago

acuarica commented 1 year ago

Some declaration .d.ts files generated by TypeScript have typecheck errors: error TS2526: A 'this' type is available only in a non-static member of a class or interface.

image
[...]
Found 76 errors in 7 files.

Errors  Files
     6  node_modules/@acuarica/evm/dist/src/evm/expr.d.ts:43
    26  node_modules/@acuarica/evm/dist/src/evm/logic.d.ts:10
    12  node_modules/@acuarica/evm/dist/src/evm/math.d.ts:9
     2  node_modules/@acuarica/evm/dist/src/evm/memory.d.ts:6
    10  node_modules/@acuarica/evm/dist/src/evm/special.d.ts:25
     4  node_modules/@acuarica/evm/dist/src/evm/storage.d.ts:71
    16  node_modules/@acuarica/evm/dist/src/evm/system.d.ts:6

It seems to be a confirmed bug in TypeScript https://github.com/microsoft/TypeScript/issues/52687. That is, this is only a problem for the typechecker, the code that generated this error is actually correct. Thus, this error is harmless and can be silenced using skipLibCheck in tsconfig.ts

        "skipLibCheck": true,

However, it is not ideal that the user needs to fix our compilation issues.

acuarica commented 8 months ago

Fixed in 26535b4966f89f7a1358c4729b803bba48707ec6.