-
-
Save fedesilva/579931 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
| // | |
| // Upper Type Bound | |
| // | |
| def upperTypeBound[AA <: A](x: AA) | |
| // equivalently, require a implict parameter of <:<[AA, A]. | |
| // This method must be used if A is an abstract type from the | |
| // enclosing scope. | |
| def upperTypeBound2[AA](x: AA)(implicit ev: AA <:< A) | |
| // | |
| // View Bound | |
| // | |
| def viewBound[AA <% A](x: AA) | |
| //compiles to: | |
| def viewBound$[AA](x: AA)(implicit ev1$: AA => A) | |
| // | |
| // Context Bound | |
| // | |
| def contextBound[X: B](x: X) | |
| //compiles to: | |
| def contextBound$[X](x: X)(implicit ev1$: B[X]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment