Skip to content

Commit d9837f0

Browse files
committed
fix typo and unassigned terms conversion
1 parent 6b143f1 commit d9837f0

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

compiler/src/dotty/tools/dotc/interactive/Completion.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ object Completion {
493493
* from T to S. It then applies conversion method for proper type parameter resolution.
494494
*
495495
* @param qual The argument to which the implicit conversion should be applied.
496-
* @return Types after implicit conversion.
496+
* @return The set of types after `qual` implicit conversion.
497497
*/
498498
private def implicitConversionTargets(qual: Tree)(using Context): Set[Type] = {
499499
val typer = ctx.typer

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2300,15 +2300,15 @@ trait Applications extends Compatibility {
23002300

23012301
try
23022302
val appliedTree = inContext(newCtx) {
2303-
newCtx.typer.typed(untpd.Apply(conversionMethodTree, (receiver:: Nil)))
2303+
typed(untpd.Apply(conversionMethodTree, untpd.TypedSplice(receiver) :: Nil))
23042304
}
23052305

23062306
if appliedTree.tpe.exists && !appliedTree.tpe.isError then
23072307
Some(appliedTree)
23082308
else
23092309
None
23102310
catch
2311-
case NonFatal(_) => None
2311+
case NonFatal(x) => None
23122312

23132313
def isApplicableExtensionMethod(methodRef: TermRef, receiverType: Type)(using Context): Boolean =
23142314
methodRef.symbol.is(ExtensionMethod) && !receiverType.isBottomType &&

language-server/test/dotty/tools/languageserver/CompletionTest.scala

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,8 +1200,8 @@ class CompletionTest {
12001200
|}
12011201
|implicit def fooToBoo[A](x: Foo[A]): Boo[A] = Boo(x.x)
12021202
|case class Bar[F[_]](bar: F[Int])
1203-
|def foo(x: Bar[M]) = x.bar.m${m1}"""
1204-
.withSource.completion(m1, expected)
1203+
|def foo(x: Bar[M]) = x.bar.m${m1}""".withSource
1204+
.completion(m1, expected)
12051205
}
12061206

12071207
@Test def higherKindedTypeInferenceTest: Unit = {
@@ -1216,8 +1216,8 @@ class CompletionTest {
12161216
| val test = new Test[Int, String] {}
12171217
| test.foo${m1}
12181218
| (new Test[Int, String] {}).foo${m2}""".withSource
1219-
.completion(m1, expected)
1220-
.completion(m2, expected)
1219+
.completion(m1, expected)
1220+
.completion(m2, expected)
12211221
}
12221222

12231223
@Test def higherKindedImplicitConversionsCompletions: Unit = {
@@ -1231,12 +1231,14 @@ class CompletionTest {
12311231
|}
12321232
|case class Boo[C](x: C) {
12331233
| def mapBoo[B](f: C => B): Boo[B] = ???
1234-
}
1234+
|}
12351235
|implicit def fooToBoo[D](x: Foo[D]): Boo[D] = Boo(x.x)
12361236
|object Test:
12371237
| val x = Foo(1)
1238-
| x.ma${m1}"""
1239-
.withSource.completion(m1, expected)
1238+
| x.ma${m1}
1239+
| Foo(1).ma${m2}""".withSource
1240+
.completion(m1, expected)
1241+
.completion(m2, expected)
12401242
}
12411243

12421244
@Test def higherKindedMatchTypeExtensionMethodCompletion: Unit = {

0 commit comments

Comments
 (0)