Skip to content

Commit a0b51cc

Browse files
Make withScalaVersion also set Scala binary version in complete (#274)
1 parent 21e576b commit a0b51cc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

interface/src/main/scala/coursier/internal/api/ApiHelper.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,11 @@ object ApiHelper {
418418
.map(repository)
419419
.toVector
420420

421+
val binVersionOpt = Option(complete.getScalaBinaryVersion)
421422
val res = coursier.complete.Complete(cache0)
422423
.withRepositories(repositories)
423-
.withScalaBinaryVersionOpt(Option(complete.getScalaBinaryVersion))
424-
.withScalaVersionOpt(Option(complete.getScalaVersion))
424+
.withScalaBinaryVersionOpt(binVersionOpt)
425+
.withScalaVersionOpt(Option(complete.getScalaVersion), binVersionOpt.isEmpty)
425426
.withInput(complete.getInput)
426427
.complete()
427428
.unsafeRun()(cache0.ec)

0 commit comments

Comments
 (0)