Created
January 1, 2019 17:59
-
-
Save manishkkatoch/b0e68f45303ee24a4915a7612a2b8e85 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
@implicitNotFound(msg = "${PName} not found in ${T}") | |
trait PropertiesExists[T, PName <: HList, PType] | |
object PropertiesExists { | |
implicit def forHNil[T, PName, PType]( | |
implicit head: PropertyExists[T, PName, PType]): PropertiesExists[T, PName :: HNil, PType] = | |
new PropertiesExists[T, PName :: HNil, PType] {} | |
implicit def forHList[T, PNameHead, PNameTail <: HList, PTypeForHead, PTypeForTail]( | |
implicit headExists: PropertyExists[T, PNameHead, PTypeForHead], | |
tailExists: PropertiesExists[T, PNameTail, PTypeForTail]) | |
: PropertiesExists[T, PNameHead :: PNameTail, PTypeForTail] = | |
new PropertiesExists[T, PNameHead :: PNameTail, PTypeForTail] {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment