From 66f197699e9212dea083ac0bb38abc2f8cdb1f2a Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 8 Nov 2023 17:04:24 +0100 Subject: [PATCH] add default cases --- packages/core/src/utils/make-namespaced.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/core/src/utils/make-namespaced.ts b/packages/core/src/utils/make-namespaced.ts index fd9be1aaa..a7f2bb9fe 100644 --- a/packages/core/src/utils/make-namespaced.ts +++ b/packages/core/src/utils/make-namespaced.ts @@ -87,31 +87,29 @@ export function makeNamespacedInput(input: SolcInput, output: SolcOutput): SolcI break; } case 'EnumDefinition': - case 'UserDefinedValueTypeDefinition': { - // keep: it may be used in structures with storage locations + case 'UserDefinedValueTypeDefinition': + default: { + // - EnumDefinition may be used in structures with storage locations + // - UserDefinedValueTypeDefinition may be used in structures with storage locations + // - default: in case unexpected ast nodes show up break; } } } break; } - case 'ErrorDefinition': - case 'FunctionDefinition': - case 'UsingForDirective': - case 'VariableDeclaration': { - modifications.push(makeDelete(node, orig)); - break; - } case 'EnumDefinition': case 'ImportDirective': case 'PragmaDirective': case 'StructDefinition': - case 'UserDefinedValueTypeDefinition': { + case 'UserDefinedValueTypeDefinition': + default: { // - EnumDefinition may be used in structures with storage locations // - ImportDirective may import types used in structures with storage locations // - PragmaDirective is necessary for compilation // - StructDefinition may be used in structures with storage locations // - UserDefinedValueTypeDefinition may be used in structures with storage locations + // - default: in case unexpected ast nodes show up (file-level events since 0.8.22) break; } }