Skip to content

Instantly share code, notes, and snippets.

@erokhins
Last active December 19, 2015 19:58
Show Gist options
  • Save erokhins/6009727 to your computer and use it in GitHub Desktop.
Save erokhins/6009727 to your computer and use it in GitHub Desktop.
public final class Attrs<out T: HtmlTag>(tag: T): AbstractCommonAttribute<Attrs<T>>(tag)
open class A(containingTag: HtmlBodyTag): AllowText, HtmlBodyTag(containingTag, "a") {
// public final class Attrs(htmlTag: HtmlTag): AbstractCommonAttribute<Attrs>(htmlTag)
public open val attr: Attrs<A> = Attrs(this)
}
public var Attrs<A>.href: Link by Attributes.href
class A1: A("") {
override val attr: Attrs<A1> = Attrs(this)
}
var Attrs<A1>.foo = 1
fun main(args: Array<String>) {
A1().attr.foo
A1().attr.href
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment