Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not for merge #1186

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

eboudrant
Copy link
Contributor

Example to illustrate problem with `@DslMarker1 and this pattern :

class Controller(val object : ...) ... {
  fun buildModels(...) {
   group {
      addSomething(...)
    }
  }
  open fun ModelCollector.addSomething(...) {
    model {
      onClick { object.doSomething(...) }
    }
  }
}


[email protected](Color.DKGRAY)
[email protected](Color.GRAY)
[email protected](Color.LTGRAY)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is here :

e: kotlinsample/src/main/java/com/airbnb/epoxy/kotlinsample/MainController.kt: (66, 33): 'fun ModelCollector.addColoredSquareView(color: Int): Unit' can't be called in this context by implicit receiver. Use the explicit one if necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will work with

        decoratedLinearGroup {
            val group = this
            id("epoxyModelGroupWithLayoutDsl")
            with (this@MainController) {
                group.addColoredSquareView(Color.DKGRAY)
                group.addColoredSquareView(Color.GRAY)
                group.addColoredSquareView(Color.LTGRAY)
            }
        }

but this is not ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant