Markdown: allow the use of an ImageCache with MarkdownComponent#114
Markdown: allow the use of an ImageCache with MarkdownComponent#114DeDiamondPro wants to merge 2 commits intoEssentialGG:masterfrom
Conversation
Johni0702
left a comment
There was a problem hiding this comment.
this change should be backwards compatible.
It's not, that's why we have the explicit API file because otherwise it might not be obvious:
The constructor with the signature (Ljava/lang/String;Lgg/essential/elementa/markdown/MarkdownConfig;FLgg/essential/elementa/font/FontProvider;ILkotlin/jvm/internal/DefaultConstructorMarker;)V is gone now.
That is the constructor which Kotlin calls when you make use of default arguments (the final I is a bit mask telling the constructor which arguments were passed (so it can differentiate between not-passed and passed-null) and the final DefaultConstructorMarker is used to differentiate the constructor from an identical one with a real final I argument (otherwise such a constructor would conflict with the Kotlin-generated one).
To add an argument to a constructor which has optional arguments, you need to take the exact constructor, make it a secondary constructor so it's still there, and then create a new primary one that has the extra argument.
src/main/kotlin/gg/essential/elementa/markdown/MarkdownComponent.kt
Outdated
Show resolved
Hide resolved
611f612 to
07d1a3f
Compare
07d1a3f to
8144287
Compare
Thank you for the explanation, I wasn't aware this is how kotlin handles constructors. I think I have fixed it now. |
This pull request allows the use of an
ImageCachewithMarkdownComponent, this change should be backwards compatible.