【发布时间】:2011-04-16 06:25:16
【问题描述】:
Scala 的Manifests 是一种解决由于 JVM 缺乏具体泛型而导致的一些类型擦除问题的方法。
在其他几个问题中讨论它们;这里有一些:
- What is a Manifest in Scala and when do you need it?
- How does Scala's (2.8) Manifest work?
- How do I get around type erasure on Scala? Or, why can't I get the type parameter of my collections?
- How can I use Scala's Manifest class to instantiate the erased class at runtime?
- Manifest vs ClassManifest. What does this Scala error mean?
其中一位 cmets 提到“此功能是实验性的,在某些情况下它不起作用。不过,它可以走很长的路。” (丹尼尔·索布拉尔)
Manifest 方法失败的情况有哪些?为什么?
【问题讨论】:
标签: generics scala manifest reification