summaryrefslogtreecommitdiff
path: root/test/files/run/t6323b.scala
Commit message (Collapse)AuthorAgeFilesLines
* deprecates api#Name.decoded and api#Name.encodedEugene Burmako2014-02-141-1/+1
| | | | | | | | | | | Presence of both decoded/encoded and decodedName/encodedName has always baffled me, as one of those method groups is clearly redundant, and this pull request presents a great opportunity to address this by deprecating one of the groups. After some deliberation, I’ve chosen decoded/encoded as the deprecation target, because its derivation from decodedName/encodedName is easier than the other way around.
* SI-6310 AbsTypeTag => WeakTypeTagEugene Burmako2012-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The new name for AbsTypeTag was a matter of a lengthy discussion: http://groups.google.com/group/scala-internals/browse_thread/thread/fb2007e61b505c4d I couldn't decide until having fixed SI-6323 today, which is about trying to reflect against a local class using typeOf. The problem with local classes is that they aren't pickled, so their metadata isn't preserved between Scala compilation runs. Sure, we can restore some of that metadata with Java reflection, but you get the idea. Before today typeOf of a local class created a free type, a synthetic symbol, with a bunch of synthetic children that remember the metadata, effectively creating a mini symbol table. That might be useful at time, but the problem is that this free type cannot be reflected, because the global symbol table of Scala reflection doesn't know about its mini symbol table. And then it struck me. It's not the presence of abs types (type parameters and abs type members) that differentiates arbitrary type tags from good type tags. It's the presence of types that don't map well on the runtime world - ones that can't be used to instantiate values, ones that can't be reflected. So we just need a name for these types. Phantom types are compile-time only concept, whereas our types can have partial correspondence with the runtime. "Weak types" sound more or less okish, so let's try them out.
* SI-6323 outlaws free types from TypeTagEugene Burmako2012-09-141-0/+21
Free types are no longer acceptable in normal type tags. Like type parameters or abstract type members they don't map on any real type, therefore I think this is a justified change. The main reason for doing is this is to prohibit people from using `typeOf` on local classes. Sure, the guard introduced in the previous commit will raise runtime errors about that, but this commit provides static checking. Those especially persistent might use `absTypeOf` and then try to play around with the weak type it returns, but that's advanced usage scenario, and I don't worry much about it. Bottom line: `typeOf` should just work. Things that work with additional effort should be explicitly marked as such.