question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kotlin DSL isn't marked with @DslMarker

See original GitHub issue

I think you force pushed the Kotlin branch and you must’ve forgot to recreate the annotation annotated with @DslMarker to mark the DSL methods as DSL methods.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

0reactions
BomBardyGamercommented, Mar 5, 2021

Actually, there isn’t any official documentation about it, you’re right. That’s strange, since it’s perfectly fine to annotate functions with @DslMarker, and it does work as intended on functions. I’m just suggesting you use the annotation because it makes the DSL easier to distinguish from regular code, and it looks nice in IntelliJ when it’s a different colour 😃

Surely though, if you weren’t meant to use it on functions, either the compiler or an article on it would say so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DSLMarker not limiting the scope of DSL - kotlin - Stack Overflow
It seems annotating the base class, in this case Tag , does the trick, that probably means all those other annotations serve no...
Read more >
DslMarker - Kotlin Programming Language
an implicit receiver may belong to a DSL @X if marked with a corresponding DSL marker annotation; two implicit receivers of the same...
Read more >
Kotlin DSL | Coding a DSL: 6— The @DslMarker annotation
These annotations are used to mark classes and receivers, preventing receivers marked with the same annotation to be accessed inside one another ...
Read more >
@Kotlin DSL Tutorial - Ximedes
With it we define an annotation that is used to mark our code as our DSL language. @DslMarker annotation class PersonDsl. Now we...
Read more >
Kotlin DSL: from Theory to Practice - Jmix
These languages are limited in functionalities but they are able to effectively address a certain problem. They allow to write not imperative code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found