Skip to content

Commit dbe969c

Browse files
committed
Test
1 parent 79f9225 commit dbe969c

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ object Typer {
7474

7575
/** Assert tree has a position, unless it is empty or a typed splice, or we are in interactive mode where some positions are missing */
7676
def assertPositioned(tree: untpd.Tree)(using Context): Unit =
77-
if (!tree.isEmpty && !tree.isInstanceOf[untpd.TypedSplice] && ctx.typerState.isGlobalCommittable && !ctx.mode.is(Interactive) )
77+
if !tree.isEmpty && !tree.isInstanceOf[untpd.TypedSplice] && ctx.typerState.isGlobalCommittable && !ctx.mode.is(Interactive) then
7878
assert(tree.span.exists, i"position not set for $tree # ${tree.uniqueId} of ${tree.getClass} in ${tree.source}; ctx.mode=${ctx.mode.bits}")
7979

8080
/** An attachment for GADT constraints that were inferred for a pattern. */

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,14 @@ class TabcompleteTests extends ReplTest {
260260
val comp = tabComplete("x.toStr")
261261
assertEquals(List("toString"), comp.distinct)
262262
}
263+
264+
@Test def tabCompleteForNamedTuple =
265+
initially {
266+
val src = "val t = (a = 1, b = 2)"
267+
run(src)
268+
} andThen {
269+
val comp = tabComplete("t.")
270+
assertTrue(s"should contain 'a' but was: ${comp.mkString(", ")}", comp.contains("a"))
271+
assertTrue(s"should contain 'b' but was: ${comp.mkString(", ")}", comp.contains("b"))
272+
}
263273
}

0 commit comments

Comments
 (0)