From e416bb6e3e6a251256fe6e609bbed2c0fe68a439 Mon Sep 17 00:00:00 2001 From: Liu Fengyun Date: Wed, 29 May 2019 14:07:05 +0200 Subject: [PATCH] Fix missing position assertion failure When there are macros, the positions are not set automatically due to different source files. --- .../src/dotty/tools/dotc/transform/InterceptedMethods.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala b/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala index 2eacd1b010e1..2cafd96a3c55 100644 --- a/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala +++ b/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala @@ -82,7 +82,7 @@ class InterceptedMethods extends MiniPhase { val Any_!= = defn.Any_!= val rewritten: Tree = tree.fun.symbol match { case Any_!= => - qual.select(defn.Any_==).appliedToArgs(tree.args).select(defn.Boolean_!) + qual.select(defn.Any_==).appliedToArgs(tree.args).select(defn.Boolean_!).withSpan(tree.span) /* /* else if (isPrimitiveValueClass(qual.tpe.typeSymbol)) { // todo: this is needed to support value classes @@ -100,7 +100,7 @@ class InterceptedMethods extends MiniPhase { // we get a primitive form of _getClass trying to target a boxed value // so we need replace that method name with Object_getClass to get correct behavior. // See SI-5568. - qual.selectWithSig(defn.Any_getClass).appliedToNone + qual.selectWithSig(defn.Any_getClass).appliedToNone.withSpan(tree.span) case _ => tree }