Skip to content

Commit 9164e1f

Browse files
committed
add comment to explain why refctx passed explicitly to selectionType
1 parent 8e2c11f commit 9164e1f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
168168
selectors match {
169169
case Pair(Ident(from), Ident(Name)) :: rest =>
170170
val selName = if (name.isTypeName) from.toTypeName else from
171+
// Pass refctx so that any errors are reported in the context of the
172+
// reference instead of the context of the import.
171173
checkUnambiguous(selectionType(site, selName, tree.pos)(refctx))
172174
case Ident(Name) :: rest =>
173175
checkUnambiguous(selectionType(site, name, tree.pos)(refctx))

0 commit comments

Comments
 (0)