Created
July 10, 2013 00:05
-
-
Save travisbrown/5962424 to your computer and use it in GitHub Desktop.
This file contains 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
scala> trait Foo[A] { def bar[B](b: B): Foo[A with B] } | |
defined trait Foo | |
scala> def baz[A](foo: Foo[A]) = foo bar 1 | |
baz: [A](foo: Foo[A])Foo[A with Int] | |
scala> def baz[A](foo: Foo[A]): Foo[A with Int] = foo bar 1 | |
<console>:8: error: type mismatch; | |
found : Int(1) | |
required: Nothing | |
def baz[A](foo: Foo[A]): Foo[A with Int] = foo bar 1 | |
^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reduced form of this Stack Overflow question.