Skip to content

Commit e50ab7c

Browse files
committed
Fix isType/isTerm predicates for splices
1 parent d0d6455 commit e50ab7c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
6969

7070
case class InfixOp(left: Tree, op: Ident, right: Tree) extends OpTree
7171
case class PostfixOp(od: Tree, op: Ident) extends OpTree
72-
case class PrefixOp(op: Ident, od: Tree) extends OpTree
72+
case class PrefixOp(op: Ident, od: Tree) extends OpTree {
73+
override def isType = op.isType
74+
override def isTerm = op.isTerm
75+
}
7376
case class Parens(t: Tree) extends ProxyTree {
7477
def forwardTo = t
7578
}

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ object Parsers {
877877
typeBounds().withPos(Position(start, in.lastOffset, start))
878878
}
879879
else if (isIdent && nme.raw.isUnary(in.name))
880-
atPos(in.offset) { PrefixOp(termIdent(), path(thisOK = true)) }
880+
atPos(in.offset) { PrefixOp(typeIdent(), path(thisOK = true)) }
881881
else path(thisOK = false, handleSingletonType) match {
882882
case r @ SingletonTypeTree(_) => r
883883
case r => convertToTypeId(r)

0 commit comments

Comments
 (0)