Skip to content

Commit a909c2f

Browse files
authored
Merge pull request #1887 from dotty-staging/fix-#1867
Fix #1867: Set position of empty refined types
2 parents bf9888e + 0ca3728 commit a909c2f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
10301030

10311031
def typedRefinedTypeTree(tree: untpd.RefinedTypeTree)(implicit ctx: Context): RefinedTypeTree = track("typedRefinedTypeTree") {
10321032
val tpt1 = if (tree.tpt.isEmpty) TypeTree(defn.ObjectType) else typedAheadType(tree.tpt)
1033-
val refineClsDef = desugar.refinedTypeToClass(tpt1, tree.refinements)
1033+
val refineClsDef = desugar.refinedTypeToClass(tpt1, tree.refinements).withPos(tree.pos)
10341034
val refineCls = createSymbol(refineClsDef).asClass
10351035
val TypeDef(_, impl: Template) = typed(refineClsDef)
10361036
val refinements1 = impl.body

tests/pos/i1867.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trait B {
2+
def f1: {}
3+
}

0 commit comments

Comments
 (0)