Skip to content

Commit aa8ebb8

Browse files
committed
TypeCheck: Add witness for error 0xFD222 during flattening with super type
1 parent 48b943f commit aa8ebb8

File tree

3 files changed

+73
-29
lines changed

3 files changed

+73
-29
lines changed

src/test/resources/testinput/CDs/AuctionCD.cd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@ classdiagram AuctionCD {
7272
association Person (bidder) <-> Message [*] <<ordered>>;
7373
association Auction <-> Message [*] <<ordered>>;
7474
association Auction -> Policy [1];
75+
association Company -> (hiwis) Student [*] <<ordered>>;
7576

7677
}

src/test/resources/testinput/CDs/AuctionCD.sym

Lines changed: 64 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"kind":"de.monticore.cdassociation._symboltable.CDAssociationSymbol",
77
"name":"participants",
8-
"association":820878444
8+
"association":288615534
99
},
1010
{
1111
"kind":"de.monticore.cdbasis._symboltable.CDTypeSymbol",
@@ -118,7 +118,7 @@
118118
"packageName":"AuctionCD",
119119
"isDefinitiveNavigable":true,
120120
"cardinality":"[*]",
121-
"association":2113243119,
121+
"association":1427775702,
122122
"type":{
123123
"kind":"de.monticore.types.check.SymTypeOfObject",
124124
"objName":"AuctionCD.Person"
@@ -221,13 +221,26 @@
221221
"packageName":"AuctionCD",
222222
"isDefinitiveNavigable":true,
223223
"cardinality":"[*]",
224-
"association":1972326147,
224+
"association":669053685,
225225
"isLeft":true,
226226
"type":{
227227
"kind":"de.monticore.types.check.SymTypeOfObject",
228228
"objName":"AuctionCD.Person"
229229
}
230230
},
231+
{
232+
"kind":"de.monticore.cdassociation._symboltable.CDRoleSymbol",
233+
"name":"hiwis",
234+
"fullName":"AuctionCD.Company.hiwis",
235+
"packageName":"AuctionCD",
236+
"isDefinitiveNavigable":true,
237+
"cardinality":"[*]",
238+
"association":896852376,
239+
"type":{
240+
"kind":"de.monticore.types.check.SymTypeOfObject",
241+
"objName":"AuctionCD.Student"
242+
}
243+
},
231244
{
232245
"kind":"de.monticore.symbols.oosymbols._symboltable.FieldSymbol",
233246
"name":"name",
@@ -253,6 +266,22 @@
253266
}
254267
]
255268
}
269+
},
270+
{
271+
"kind":"de.monticore.symbols.oosymbols._symboltable.FieldSymbol",
272+
"name":"hiwis",
273+
"fullName":"AuctionCD.Company.hiwis",
274+
"packageName":"AuctionCD",
275+
"type":{
276+
"kind":"de.monticore.types.check.SymTypeOfGenerics",
277+
"typeConstructorFullName":"java.util.Set",
278+
"arguments":[
279+
{
280+
"kind":"de.monticore.types.check.SymTypeOfObject",
281+
"objName":"AuctionCD.Student"
282+
}
283+
]
284+
}
256285
}
257286
]
258287
}
@@ -285,7 +314,7 @@
285314
"packageName":"AuctionCD",
286315
"isDefinitiveNavigable":true,
287316
"cardinality":"[*]",
288-
"association":820878444,
317+
"association":288615534,
289318
"type":{
290319
"kind":"de.monticore.types.check.SymTypeOfObject",
291320
"objName":"AuctionCD.Person"
@@ -298,7 +327,7 @@
298327
"packageName":"AuctionCD",
299328
"isDefinitiveNavigable":true,
300329
"cardinality":"[*]",
301-
"association":1764291958,
330+
"association":229919394,
302331
"type":{
303332
"kind":"de.monticore.types.check.SymTypeOfObject",
304333
"objName":"AuctionCD.Message"
@@ -311,7 +340,7 @@
311340
"packageName":"AuctionCD",
312341
"isDefinitiveNavigable":true,
313342
"cardinality":"[1]",
314-
"association":1712230656,
343+
"association":769877691,
315344
"type":{
316345
"kind":"de.monticore.types.check.SymTypeOfObject",
317346
"objName":"AuctionCD.Policy"
@@ -533,7 +562,7 @@
533562
"fullName":"AuctionCD.Message.bidder",
534563
"packageName":"AuctionCD",
535564
"isDefinitiveNavigable":true,
536-
"association":896852376,
565+
"association":1324262781,
537566
"isLeft":true,
538567
"type":{
539568
"kind":"de.monticore.types.check.SymTypeOfObject",
@@ -546,7 +575,7 @@
546575
"fullName":"AuctionCD.Message.auction",
547576
"packageName":"AuctionCD",
548577
"isDefinitiveNavigable":true,
549-
"association":1764291958,
578+
"association":229919394,
550579
"isLeft":true,
551580
"type":{
552581
"kind":"de.monticore.types.check.SymTypeOfObject",
@@ -612,22 +641,12 @@
612641
"name":"auction",
613642
"fullName":"AuctionCD.Policy.auction",
614643
"packageName":"AuctionCD",
615-
"association":1712230656,
644+
"association":769877691,
616645
"isLeft":true,
617646
"type":{
618647
"kind":"de.monticore.types.check.SymTypeOfObject",
619648
"objName":"AuctionCD.Auction"
620649
}
621-
},
622-
{
623-
"kind":"de.monticore.symbols.oosymbols._symboltable.FieldSymbol",
624-
"name":"auction",
625-
"fullName":"AuctionCD.Policy.auction",
626-
"packageName":"AuctionCD",
627-
"type":{
628-
"kind":"de.monticore.types.check.SymTypeOfObject",
629-
"objName":"AuctionCD.Auction"
630-
}
631650
}
632651
]
633652
}
@@ -692,7 +711,7 @@
692711
"fullName":"AuctionCD.Person.allData",
693712
"packageName":"AuctionCD",
694713
"isDefinitiveNavigable":true,
695-
"association":2113243119,
714+
"association":1427775702,
696715
"isLeft":true,
697716
"type":{
698717
"kind":"de.monticore.types.check.SymTypeOfObject",
@@ -706,7 +725,7 @@
706725
"packageName":"AuctionCD",
707726
"isDefinitiveNavigable":true,
708727
"cardinality":"[*]",
709-
"association":820878444,
728+
"association":288615534,
710729
"isLeft":true,
711730
"type":{
712731
"kind":"de.monticore.types.check.SymTypeOfObject",
@@ -720,7 +739,7 @@
720739
"packageName":"AuctionCD",
721740
"isDefinitiveNavigable":true,
722741
"cardinality":"[1]",
723-
"association":1972326147,
742+
"association":669053685,
724743
"type":{
725744
"kind":"de.monticore.types.check.SymTypeOfObject",
726745
"objName":"AuctionCD.Company"
@@ -733,7 +752,7 @@
733752
"packageName":"AuctionCD",
734753
"isDefinitiveNavigable":true,
735754
"cardinality":"[*]",
736-
"association":896852376,
755+
"association":1324262781,
737756
"type":{
738757
"kind":"de.monticore.types.check.SymTypeOfObject",
739758
"objName":"AuctionCD.Message"
@@ -838,6 +857,18 @@
838857
"isConstructor":true,
839858
"isPublic":true,
840859
"isStatic":true
860+
},
861+
{
862+
"kind":"de.monticore.cdassociation._symboltable.CDRoleSymbol",
863+
"name":"company",
864+
"fullName":"AuctionCD.Student.company",
865+
"packageName":"AuctionCD",
866+
"association":896852376,
867+
"isLeft":true,
868+
"type":{
869+
"kind":"de.monticore.types.check.SymTypeOfObject",
870+
"objName":"AuctionCD.Company"
871+
}
841872
}
842873
]
843874
}
@@ -936,27 +967,31 @@
936967
}
937968
],
938969
"furtherObjects":{
939-
"820878444":{
970+
"1324262781":{
940971
"kind":"de.monticore.cdassociation._symboltable.SymAssociation",
941972
"isAssociation":true
942973
},
943-
"2113243119":{
974+
"669053685":{
944975
"kind":"de.monticore.cdassociation._symboltable.SymAssociation",
945976
"isAssociation":true
946977
},
947-
"1972326147":{
978+
"229919394":{
948979
"kind":"de.monticore.cdassociation._symboltable.SymAssociation",
949980
"isAssociation":true
950981
},
951-
"896852376":{
982+
"769877691":{
983+
"kind":"de.monticore.cdassociation._symboltable.SymAssociation",
984+
"isAssociation":true
985+
},
986+
"1427775702":{
952987
"kind":"de.monticore.cdassociation._symboltable.SymAssociation",
953988
"isAssociation":true
954989
},
955-
"1764291958":{
990+
"896852376":{
956991
"kind":"de.monticore.cdassociation._symboltable.SymAssociation",
957992
"isAssociation":true
958993
},
959-
"1712230656":{
994+
"288615534":{
960995
"kind":"de.monticore.cdassociation._symboltable.SymAssociation",
961996
"isAssociation":true
962997
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* (c) https://github.com/MontiCore/monticore */
2+
3+
import example.CDs.AuctionCD.*;
4+
5+
ocl flatteningWithSuperType {
6+
context Company c inv:
7+
true isin c.hiwis.isActive;
8+
}

0 commit comments

Comments
 (0)