Created
April 25, 2017 16:13
-
-
Save olafurpg/33bb4874f83c2784802bfa526bc0cc74 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package commandeer | |
import scala.language.higherKinds | |
trait CommandeerDSL[Host] | |
object CommandeerDSL { | |
def apply[Host, DSL <: CommandeerDSL[Host]](host: Host)(implicit dsl: DSL): DSL = dsl | |
} | |
trait Foo | |
object Foo { | |
implicit val fooDSL: FooDSL = new FooDSL {} | |
} | |
trait FooDSL extends CommandeerDSL[Foo] | |
object RunMe { | |
CommandeerDSL(null.asInstanceOf[Foo]) // (Foo.fooDSL) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment