Is there a way to generically obtain a Scala type’s manifest? For example, if I only have a Class reference to work with, is there a way I can obtain its corresponding manifest?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Scala’s built-in
implicitly[T]will get you an implicit value of type T (if one exists). Soimplicitly[Manifest[T]]will return a Manifest for type T.If you have a Class reference, you can get the Manifest for the Class like this:
The Manifest’s type is
_ <: Fooinstead of justFoo, but they are equal.