Opened 9 years ago
Last modified 9 years ago
#3725 accepted defect
loadString merge=true create duplicate elements
Reported by: | Adeel Asghar | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | Interactive Environment | Version: | v1.9.4-dev-nightly |
Keywords: | Cc: |
Description
Run the attached script.
Attachments (1)
Change History (6)
by , 9 years ago
Attachment: | script.mos added |
---|
comment:1 by , 9 years ago
Status: | new → accepted |
---|
comment:2 by , 9 years ago
comment:3 by , 9 years ago
so you mean setSourceFile(Test, "Test");
doesn't set filename for all elements?
comment:4 by , 9 years ago
No. Just for that class, the elements inside the class are not affected.
I think it should behave like that anyway as if it would set all the elements then you might have issues with the packages loaded inside other packages.
comment:5 by , 9 years ago
It should set it for all non-class elements (or the file merging should assume variables, etc are part of the class since they can't be part of another file).
Note:
See TracTickets
for help on using tickets.
The problem in the script above does this:
If you remove it, everything is fine.
The merge is implemented like:
In this case we do:
Test in this case was set via setSourceFile
Removes nothing because all elements have filename
<interactive> and not Test
So basically what happens is that we duplicate the class contents and then do union which keeps both parameter
Integer N = 2;
andInteger N = 2;
because they are different.I'll see how I can fix this.