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
When given legacy JSON ASTs, there is some fragile code in LegacyTupleExpressionProcessor.extractComponentsFromTypeString that tries to guess what the components of a tuple are based on the type string. When this fails, we get a crash like this one:
Error: Expected component of type uint256 but got component of type tuple(uint256,uint256)
at LegacyTupleExpressionProcessor.extractComponentsFromTypeString (src/ast/legacy/tuple_expression_processor.ts:78:27)
at LegacyTupleExpressionProcessor.process (src/ast/legacy/tuple_expression_processor.ts:22:20)
at ASTReader.convert (src/ast/ast_reader.ts:244:32)
at ASTReader.convertArray (src/ast/ast_reader.ts:263:35)
at LegacyReturnProcessor.process (src/ast/legacy/return_processor.ts:13:48)
at ASTReader.convert (src/ast/ast_reader.ts:244:32)
at ASTReader.convertArray (src/ast/ast_reader.ts:263:35)
at LegacyBlockProcessor.process (src/ast/legacy/block_processor.ts:14:35)
at ASTReader.convert (src/ast/ast_reader.ts:244:32)
at ASTReader.convertArray (src/ast/ast_reader.ts:263:35)
at LegacyFunctionDefinitionProcessor.process (src/ast/legacy/function_definition_processor.ts:21:33)
at ASTReader.convert (src/ast/ast_reader.ts:244:32)
at ASTReader.convertArray (src/ast/ast_reader.ts:263:35)
at LegacyContractDefinitionProcessor.process (src/ast/legacy/contract_definition_processor.ts:15:33)
at ASTReader.convert (src/ast/ast_reader.ts:244:32)
at ASTReader.convertArray (src/ast/ast_reader.ts:263:35)
at LegacySourceUnitProcessor.process (src/ast/legacy/source_unit_processor.ts:13:33)
at ASTReader.convert (src/ast/ast_reader.ts:244:32)
at ASTReader.read (src/ast/ast_reader.ts:220:37)
at Context.<anonymous> (test/integration/types/infer.spec.ts:705:40)
at processImmediate (node:internal/timers:471:21)
This happens relatively rarely (seen 7 times over 75K contracts), and only on old compiler versions (0.4.x) and only when directly given legacy JSON without source code.
We might consider fixing this if there are complaints about it, otherwise might leave as unfixed.
The text was updated successfully, but these errors were encountered:
When given legacy JSON ASTs, there is some fragile code in
LegacyTupleExpressionProcessor.extractComponentsFromTypeString
that tries to guess what the components of a tuple are based on the type string. When this fails, we get a crash like this one:This happens relatively rarely (seen 7 times over 75K contracts), and only on old compiler versions (0.4.x) and only when directly given legacy JSON without source code.
We might consider fixing this if there are complaints about it, otherwise might leave as unfixed.
The text was updated successfully, but these errors were encountered: