Skip to content

Commit a49ccd0

Browse files
olhotakDarkDimius
authored andcommitted
add comment to explain why refctx passed explicitly to selectionType
1 parent 2bb20fe commit a49ccd0

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
@@ -169,6 +169,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
169169
selectors match {
170170
case Pair(Ident(from), Ident(Name)) :: rest =>
171171
val selName = if (name.isTypeName) from.toTypeName else from
172+
// Pass refctx so that any errors are reported in the context of the
173+
// reference instead of the context of the import.
172174
checkUnambiguous(selectionType(site, selName, tree.pos)(refctx))
173175
case Ident(Name) :: rest =>
174176
checkUnambiguous(selectionType(site, name, tree.pos)(refctx))

0 commit comments

Comments
 (0)