Skip to content

Commit c6cbf94

Browse files
committed
ST6RI-888 Added tests that fail due to owned cross feature typing bug.
1 parent a9b831b commit c6cbf94

3 files changed

Lines changed: 67 additions & 3 deletions

File tree

kerml/src/examples/Simple Tests/Associations.kerml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,12 @@ package Associations {
1111
end x1;
1212
end [0..*] feature y1 redefines y;
1313
}
14+
15+
metaclass M;
16+
assoc XY {
17+
end [0..1] feature x : X {
18+
@M;
19+
}
20+
end feature y : Y;
21+
}
1422
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
//*
2+
XPECT_SETUP org.omg.kerml.xpect.tests.parsing.KerMLParsingTest
3+
ResourceSet {
4+
ThisFile {}
5+
File {from ="/library/Base.kerml"}
6+
File {from ="/library/Links.kerml"}
7+
File {from ="/library/Occurrences.kerml"}
8+
File {from ="/library/Performances.kerml"}
9+
File {from ="/library/Objects.kerml"}
10+
File {from ="/library/Metaobjects.kerml"}
11+
}
12+
Workspace {
13+
JavaProject {
14+
SrcFolder {
15+
ThisFile {}
16+
File {from ="/library/Base.kerml"}
17+
File {from ="/library/Links.kerml"}
18+
File {from ="/library/Occurrences.kerml"}
19+
File {from ="/library/Performances.kerml"}
20+
File {from ="/library/Objects.kerml"}
21+
File {from ="/library/Metaobjects.kerml"}
22+
}
23+
}
24+
}
25+
END_SETUP
26+
*/
27+
28+
// XPECT noErrors ---> ""
29+
package Associations {
30+
datatype X;
31+
class Y;
32+
33+
assoc A {
34+
end x_cross [1..1] feature x : X;
35+
end y_cross [1..*] feature y : Y;
36+
}
37+
38+
assoc B specializes A {
39+
end x1;
40+
end [0..*] feature y1 redefines y;
41+
}
42+
43+
metaclass M;
44+
assoc XY {
45+
// Ensure that the owned cross feature is typed correctly,
46+
// even though getting type of end feature requires resolving
47+
// metadata nam to check if it is SemanticMetadata, which
48+
// requires getting supertypes of end feature, including its types.
49+
end [0..1] #M feature x : X;
50+
end [0..1] #M feature y : Y;
51+
}
52+
}

sysml/src/examples/Simple Tests/ConnectionTest.sysml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ package ConnectionTest {
3939

4040
connection {
4141
part q;
42-
end [2] ref end1 ::> d1 :> q;
42+
end ref end1 ::> d1 :> q;
4343
end end2 ::> d2;
4444
}
4545

@@ -54,7 +54,11 @@ package ConnectionTest {
5454
part def B;
5555

5656
connection def AB {
57-
end a : A;
58-
end b : B crosses a.b;
57+
end [1] item a : A {
58+
@M;
59+
}
60+
end b : B;
5961
}
62+
63+
metadata def M;
6064
}

0 commit comments

Comments
 (0)