Commit 6a69775b authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Detect more type mismatch

TypeA ::= SEQUENCE {
  a SEQUENCE (SIZE (2)) OF BOOLEAN
}

TypeB ::= SEQUENCE {
  a SEQUENCE (SIZE(2)) OF BOOLEAN
}

dcl a TypeA, b TypeB;
a!a := b!a
now rightfully raises an error, even if the types seem semantically
equivalent- they are two different types, and Ada would not compile
accept that.
parent 3f46221c
......@@ -146,6 +146,7 @@ Changelog
- Better support of warnings
- Fixed detection of CHOICE assignment erros
- Raise error if process miss the start transition
- Raise error in case of SEQUENCE OF type mismatch
1.5.12 (09/2016)
- Detect duplicate declaration of procedures
......
......@@ -902,6 +902,8 @@ def compare_types(type_a, type_b): # type -> [warnings]
if type_a.kind == type_b.kind:
if type_a.kind == 'SequenceOfType':
if mismatch:
raise TypeError(mismatch)
if type_a.Min == type_a.Max:
if type_a.Min == type_b.Min == type_b.Max:
warnings.extend(compare_types(type_a.type, type_b.type))
......
Markdown is supported
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