Repository navigation
🐛 Allow declaring a metaclass, protocol, struct, exception, stereotype or entity after its first use - #3006
Merged
arnaudroques merged 1 commit intoNov 13, 2026
Conversation
…e or entity after its first use A relation like "MetaClass <|-- MetaSubclass" creates MetaClass as a class. A later "metaclass MetaClass" then failed because muteToType only allowed switching between class, abstract class, interface, enum, annotation, record and dataclass. Fixes plantuml#2668
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2668
A class-like element that is used in a relation before it is declared fails when the declaration uses
metaclass,protocol,struct,exception,stereotypeorentity:The relation creates
MetaClassas a plain class. Whenmetaclass MetaClasscomes later,CommandCreateClass/CommandCreateClassMultilinescallEntity.muteToType, which only allows switching between class, abstract class, interface, enum, annotation, record and dataclass, so it returns false and the line is reported as an error. Withclass,interface,enumand the others in the list, the same order already works.The change moves that list into one
EnumSetand addsPROTOCOL,STRUCT,EXCEPTION,METACLASS,STEREOTYPEandENTITY. Nothing else inmuteToTypechanges.Tests: two Vega non-regression cases in
vega/nonreg/group2668, the reported metaclass hierarchy and one relation for each of the other five keywords (each element keeps its own marker: P, S, X, S, E). Both fail before the change../gradlew test --tests test.vega.VegaTestpasses apart from theazure_iot,azure_simpleandosa2/examplestdlib cases, and the full./gradlew testadds onlyStringBounderEmbeddedFontTest; those fail the same way on master on this machine.