-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #1284: Make classTag depend directly on erasure #1412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import printing.Showable | |
import Contexts._ | ||
import Types._ | ||
import Flags._ | ||
import TypeErasure.{erasure, hasStableErasure} | ||
import Mode.ImplicitsEnabled | ||
import Denotations._ | ||
import NameOps._ | ||
|
@@ -479,15 +480,12 @@ trait Implicits { self: Typer => | |
formal.argTypes match { | ||
case arg :: Nil => | ||
val tp = fullyDefinedType(arg, "ClassTag argument", pos) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This call was previously returning There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not directly comparable. My point is the new implementation has some justification (stable erasure) where the old one hadn't. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. |
||
tp.underlyingClassRef(refinementOK = false) match { | ||
case tref: TypeRef => | ||
return ref(defn.ClassTagModule) | ||
.select(nme.apply) | ||
.appliedToType(tp) | ||
.appliedTo(clsOf(tref)) | ||
.withPos(pos) | ||
case _ => | ||
} | ||
if (hasStableErasure(tp)) | ||
return ref(defn.ClassTagModule) | ||
.select(nme.apply) | ||
.appliedToType(tp) | ||
.appliedTo(clsOf(erasure(tp))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's an interesting DSL! Does it cover the entire language, or it just contains a few most used utilities? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It covers about 30 ops, maybe half of them construct syntax trees. See |
||
.withPos(pos) | ||
case _ => | ||
} | ||
EmptyTree | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
case object A | ||
case object B | ||
|
||
object Test { | ||
def main(args: Array[String]): Unit = { | ||
assert(Array(A, B).deep.toString == "Array(A, B)") | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why these newlines?