Skip to content

Implement scope control for the DSL #25

@nesk

Description

@nesk

https://kotlinlang.org/docs/type-safe-builders.html#scope-control-dslmarker

becomes necessary when writing this kind of code:

labels { // this: Validatable<List<String>>
    hasSizeLowerThanOrEqualTo(3) // OK

    each {
        hasLengthGreaterThanOrEqualTo(1) // OK
        hasSizeGreaterThanOrEqualTo(1) // OK BUT SHOULDN'T BE (applied to the list, not to the string)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    DSLAPI design and its DSLcoreThe core of the library is involvedenhancementNew feature or request

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions