@@ -7635,7 +7635,7 @@ algorithm
76357635 Env.Cache cache;
76367636 SCode.Element c1, c2;
76377637 Absyn.Path tpath1, tpath2;
7638- Absyn.Info aInfo ;
7638+ Absyn.Info old_info, new_info ;
76397639 SCode.Prefixes prefixes1, prefixes2;
76407640 SCode.Attributes attr1,attr2;
76417641 Absyn.TypeSpec tp1,tp2;
@@ -7650,13 +7650,14 @@ algorithm
76507650 // NOTE: Should be type identical instead? see spec.
76517651 // p.23, check of flattening. "Check that duplicate elements are identical".
76527652 true = SCode.elementEqual(oldElt,newElt);
7653- then ();
7653+ then
7654+ ();
76547655
76557656 // adrpo: see if they are not syntactically equivalent, but semantically equivalent!
76567657 // see Modelica Spec. 3.1, page 66.
76577658 // COMPONENT
7658- case (cache,env,(oldElt as SCode.COMPONENT(n1, prefixes1, attr1, tp1 as Absyn.TPATH(tpath1, ad1), smod1, _, cond1, aInfo ),oldMod),
7659- (newElt as SCode.COMPONENT(n2, prefixes2, attr2, tp2 as Absyn.TPATH(tpath2, ad2), smod2, _, cond2, _ ),newMod))
7659+ case (cache,env,(oldElt as SCode.COMPONENT(n1, prefixes1, attr1, tp1 as Absyn.TPATH(tpath1, ad1), smod1, _, cond1, old_info ),oldMod),
7660+ (newElt as SCode.COMPONENT(n2, prefixes2, attr2, tp2 as Absyn.TPATH(tpath2, ad2), smod2, _, cond2, new_info ),newMod))
76607661 equation
76617662 // see if the most stuff is the same!
76627663 true = stringEq(n1, n2);
@@ -7675,13 +7676,15 @@ algorithm
76757676 // add a warning and let it continue!
76767677 s1 = SCodeDump.unparseElementStr(oldElt);
76777678 s2 = SCodeDump.unparseElementStr(newElt);
7678- Error.addSourceMessage(Error.DUPLICATE_ELEMENTS_NOT_SYNTACTICALLY_IDENTICAL,{s1,s2}, aInfo);
7679- then ();
7679+ Error.addMultiSourceMessage(Error.DUPLICATE_ELEMENTS_NOT_SYNTACTICALLY_IDENTICAL,
7680+ {s1, s2}, {old_info, new_info});
7681+ then
7682+ ();
76807683
76817684 // adrpo: handle bug: https://trac.modelica.org/Modelica/ticket/627
76827685 // TODO! FIXME! REMOVE! remove when the bug is fixed!
7683- case (cache,env,(oldElt as SCode.COMPONENT(n1, prefixes1, attr1, tp1 as Absyn.TPATH(tpath1, ad1), smod1, _, cond1, aInfo ),oldMod),
7684- (newElt as SCode.COMPONENT(n2, prefixes2, attr2, tp2 as Absyn.TPATH(tpath2, ad2), smod2, _, cond2, _ ),newMod))
7686+ case (cache,env,(oldElt as SCode.COMPONENT(n1, prefixes1, attr1, tp1 as Absyn.TPATH(tpath1, ad1), smod1, _, cond1, old_info ),oldMod),
7687+ (newElt as SCode.COMPONENT(n2, prefixes2, attr2, tp2 as Absyn.TPATH(tpath2, ad2), smod2, _, cond2, new_info ),newMod))
76857688 equation
76867689 // see if the most stuff is the same!
76877690 true = stringEq(n1, n2);
@@ -7703,17 +7706,20 @@ algorithm
77037706 s2 = SCodeDump.unparseElementStr(newElt);
77047707 s = "Inherited elements are not identical: bug: https://trac.modelica.org/Modelica/ticket/627\n\tfirst: " +&
77057708 s1 +& "\n\tsecond: " +& s2 +& "\nContinue ....";
7706- Error.addSourceMessage (Error.COMPILER_WARNING, {s}, aInfo );
7709+ Error.addMultiSourceMessage (Error.COMPILER_WARNING, {s}, {old_info, new_info} );
77077710 then ();
77087711
77097712 // fail baby and add a source message!
7710- case (cache, env, (oldElt as SCode.COMPONENT(info=aInfo),oldMod),(newElt,newMod))
7713+ case (cache, env, (oldElt as SCode.COMPONENT(info = old_info),oldMod),
7714+ (newElt as SCode.COMPONENT(info = new_info),newMod))
77117715 equation
77127716 s1 = SCodeDump.unparseElementStr(oldElt);
77137717 s2 = SCodeDump.unparseElementStr(newElt);
7714- Error.addSourceMessage(Error.DUPLICATE_ELEMENTS_NOT_IDENTICAL,{s1,s2}, aInfo);
7715- //print(" *** error message added *** \n");
7716- then fail();
7718+ Error.addMultiSourceMessage(Error.DUPLICATE_ELEMENTS_NOT_IDENTICAL,
7719+ {s1, s2}, {old_info, new_info});
7720+ then
7721+ fail();
7722+
77177723 end matchcontinue;
77187724end checkMultipleElementsIdentical;
77197725
0 commit comments