Skip to content

Commit c1aec9c

Browse files
committed
inline it
1 parent b9fc4a3 commit c1aec9c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,12 @@ object DottyPlugin extends AutoPlugin {
269269
},
270270
// ... instead, we'll fetch the compiler and its dependencies ourselves.
271271
scalaInstance := Def.taskDyn {
272-
val isD = isDotty.value
273-
val si = scalaInstance.taskValue
274-
val siTaskInitialize = Def.valueStrict { si }
275-
if (isD) dottyScalaInstance
276-
else siTaskInitialize
272+
if (isDotty.value) dottyScalaInstance
273+
else {
274+
// This dereferences the Initialize graph, but keeps the Task unevaluated,
275+
// so its effect gets fired only when isDotty.value evalutes to false. yay monad.
276+
Def.valueStrict { scalaInstance.taskValue }
277+
}
277278
}.value,
278279
dottyScalaInstance := {
279280
val updateReport =

0 commit comments

Comments
 (0)