Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
4948d868
Commit
4948d868
authored
Jun 27, 2020
by
Maxime Perrotin
Browse files
Fix use of ASN.1 constant using MIN constraint
parent
fc1eae18
Changes
1
Hide whitespace changes
Inline
Side-by-side
opengeode/ogParser.py
View file @
4948d868
...
...
@@ -1206,7 +1206,16 @@ def compare_types(type_a, type_b): # type -> [warnings]
raise
TypeError
(
mismatch
)
elif
type_a
.
kind
==
'IntegerType'
:
# Detect Signed/Unsigned type mismatch
min_a
,
min_b
=
float
(
type_a
.
Min
),
float
(
type_b
.
Min
)
try
:
min_a
=
float
(
type_a
.
Min
)
except
ValueError
:
# "MIN" instead of a number
# Since we only want to check sign compatibility, set -1
min_a
=
-
1
try
:
min_b
=
float
(
type_b
.
Min
)
except
ValueError
:
min_b
=
-
1
if
(
min_a
>=
0
)
!=
(
min_b
>=
0
)
\
and
not
(
is_number
(
type_a
)
or
is_number
(
type_b
)):
raise
TypeError
(
"Signed vs Unsigned type mismatch "
+
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment