Bug using generics in latest version?

0 votes
asked Nov 12, 2016 in Bug by olesam (120 points)
In earlier version, I could use generics for defines classes.

(Genereics described in chapter 3.14 in the PlantUML_Language_Reference_Guide.pdf

 

Example:

This worked i erlier versions: (I have a plantuml.jar version 8048 locally - and it works):

@startuml
!define table(x) class x << (T,mistyrose) >>  
table("m3.Table1" <generic here>)
table("m3.Table2" <generic here too>)
m3.Table1 -> m3.Table2
@enduml

 

 

plantuml.jar version 8049, the online version and the Chrome addin all gives me error message

Syntax Error?

Did you mean:

table-("m3.Table1" <generic here>)

 

If I remove the generics like this - it works:

@startuml
!define table(x) class x << (T,mistyrose) >>  
table("m3.Table1" )
table("m3.Table2" )
m3.Table1 -> m3.Table2
@enduml

1 Answer

0 votes
answered Nov 13, 2016 by plantuml (295,000 points)
selected Nov 13, 2016 by olesam
 
Best answer

Hi,

Thanks for the report.

Actually, the bug comes from a slight change in the preprocessor itself. In that case, you can add simple quotes to let your diagram work:

@startuml
!define table(x) class x << (T,mistyrose) >>  
table('"m3.Table1" <generic here>')
table('"m3.Table2" <generic here too>')
m3.Table1 -> m3.Table2
@enduml

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuL9CIKtBp4jLA4bCoadLgD1KICv9B2vMg52miL7G2D79pImkgIpABqxLLB2pKr3WWYXJLyerrWi1CGsL56pIK_DIYpAJ5J9IYrBjr3Knr1YXgL4eoSy7gOEReQ1hfm1NpEMGcfS2T1a0

Is this workaround ok for you ?

Thanks

commented Nov 13, 2016 by olesam (120 points)
Thank you for you very quick and accurate answer.
Your solutions works fine!
...