Created
July 24, 2010 01:17
-
-
Save etorreborre/488281 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
/** | |
* A quick debugging tip | |
*/ | |
/** | |
* If you have lots of definitions using the same type parameter names, like 'S' | |
*/ | |
def beEmpty[S <: HasIsEmpty]: Matcher[S] = new EmptyMatcher() | |
def compose[S] (f: S => T) = new Matcher[S] { ... } | |
/** | |
* You may get cryptic compiler messages: "could not find implicit value for parameter c: (B) => S" | |
* | |
* Just change (temporarily) the type variable to: | |
*/ | |
def beEmpty[SHasIsEmpty <: HasIsEmpty]: Matcher[SHasIsEmpty] = new EmptyMatcher() | |
/** | |
* And things start getting clearer! | |
* | |
* "could not find implicit value for parameter c: (B) => SHasIsEmpty" | |
*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment