Skip to content

Commit

Permalink
add default cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed Nov 8, 2023
1 parent 2af8660 commit 66f1976
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions packages/core/src/utils/make-namespaced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 66f1976

Please sign in to comment.