Skip to content

Instantly share code, notes, and snippets.

@dcsobral
Created October 25, 2012 00:41
Show Gist options
  • Save dcsobral/3949827 to your computer and use it in GitHub Desktop.
Save dcsobral/3949827 to your computer and use it in GitHub Desktop.
Miles Sabin Exercise
scala> class Tester[R <: ResourceManager#Resource] {
| def apply(r: R) = assert(r.hash == "9e47088d", "Expected: 9e47088d, Found: "+r.hash)
| }
defined class Tester
scala> def testHash[RM <: ResourceManager](rm: RM) = new Tester[rm.Resource]
testHash: [RM <: ResourceManager](rm: RM)Tester[rm.Resource]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment