Skip to content

Commit 84c26ec

Browse files
committed
Whichhunting: method signatures change after typer.
1 parent 53979ee commit 84c26ec

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

compiler/src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ object Trees {
6363

6464
private def nxId = {
6565
nextId += 1
66+
if ((nextId == 94) && (nextId < 170)) {
67+
println("dssds")
68+
}
6669
//assert(nextId != 199, this)
6770
nextId
71+
6872
}
6973

7074
/** A unique identifier for this tree. Used for debugging, and potentially
@@ -74,6 +78,7 @@ object Trees {
7478

7579
def uniqueId = myUniqueId
7680

81+
7782
/** The type constructor at the root of the tree */
7883
type ThisTree[T >: Untyped] <: Tree[T]
7984

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,9 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
479479

480480
override def Select(tree: Tree)(qualifier: Tree, name: Name)(implicit ctx: Context): Select = {
481481
val tree1 = untpd.cpy.Select(tree)(qualifier, name)
482+
lazy val oldMember = tree.asInstanceOf[Select].qualifier.tpe.member(name)
482483
tree match {
483-
case tree: Select if qualifier.tpe eq tree.qualifier.tpe =>
484+
case tree: Select if (qualifier.tpe eq tree.qualifier.tpe) && (oldMember.isOverloaded || oldMember.signature == qualifier.tpe.member(name).signature) =>
484485
tree1.withTypeUnchecked(tree.tpe)
485486
case _ => tree.tpe match {
486487
case tpe: NamedType => tree1.withType(tpe.derivedSelect(qualifier.tpe.widenIfUnstable))

compiler/src/dotty/tools/dotc/printing/Formatting.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ object Formatting {
2929

3030
protected def showArg(arg: Any)(implicit ctx: Context): String = arg match {
3131
case arg: Showable =>
32-
try arg.show
33-
catch {
34-
case NonFatal(ex) => s"[cannot display due to $ex, raw string = $toString]"
35-
}
32+
//try
33+
arg.show
34+
// catch {
35+
//case NonFatal(ex) => s"[cannot display due to $ex, raw string = $toString]"
36+
// }
3637
case _ => arg.toString
3738
}
3839

compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ trait TypeAssigner {
211211
/** The type of a selection with `name` of a tree with type `site`.
212212
*/
213213
def selectionType(site: Type, name: Name, pos: Position)(implicit ctx: Context): Type = {
214+
if (name.toString == "specializedFor")
215+
println("bugaga")
214216
val mbr = site.member(name)
215217
if (reallyExists(mbr)) site.select(name, mbr)
216218
else if (site.derivesFrom(defn.DynamicClass) && !Dynamic.isDynamicMethod(name)) {

0 commit comments

Comments
 (0)