Skip to content

Commit 9a2d2d1

Browse files
Merge pull request #6429 from dotty-staging/i6415
Fix #6415: Enable REPL code completion for opaque types
2 parents a7dbb6c + bef2849 commit 9a2d2d1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ object desugar {
828828
val moduleName = tdef.name.toTermName
829829
val localRef = Select(Ident(moduleName), tdef.name)
830830
localRef.pushAttachment(SuppressAccessCheck, ())
831-
val aliasType = cpy.TypeDef(tdef)(rhs = completeForwarder(localRef))
831+
val aliasType = cpy.TypeDef(tdef)(rhs = completeForwarder(localRef)).withSpan(tdef.span.startPos)
832832
val localType = tdef.withMods(Modifiers(Synthetic | Opaque).withPrivateWithin(tdef.name))
833833

834834
val companions = moduleDef(ModuleDef(

compiler/test/dotty/tools/repl/TabcompleteTests.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,8 @@ class TabcompleteTests extends ReplTest {
128128
@Test def moduleCompletion = fromInitialState { implicit s =>
129129
assertEquals(List("Predef"), tabComplete("object Foo { type T = Pre"))
130130
}
131+
132+
@Test def i6415 = fromInitialState { implicit s =>
133+
assertEquals(List("Predef"), tabComplete("opaque type T = Pre"))
134+
}
131135
}

0 commit comments

Comments
 (0)