Commit 9e1defb0 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Properly find fields in lookup table

parent ceeb965b
......@@ -1074,8 +1074,10 @@ def fix_expression_types(expr, context): # type: -> [warnings]
for field, fd_expr in expr.right.value.viewitems():
# if fd_expr.exprType == UNKNOWN_TYPE:
try:
expected_type = asn_type.Children.get(
field.lower().replace('_', '-')).type
for spelling in asn_type.Children:
if field.lower().replace('_', '-') == spelling.lower():
break
expected_type = asn_type.Children[spelling].type
except AttributeError:
raise TypeError('Field not found: ' + field)
check_expr = ogAST.ExprAssign()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment