Skip to content

Commit 0f54971

Browse files
committed
Attempt to make this work with scala/scala3#3421
Replace the use of ambiguous implicits by the `scala.implicits.Not` class introduced in the PR. Running `sbt dottyThing/compile` crashes with: [info] exception occurred while compiling /home/smarter/opt/shims/dottyThing/src/main/scala/shims/dotty/test.scala java.lang.AssertionError: assertion failed at dotty.DottyPredef$.assertFail(DottyPredef.scala:38) at dotty.tools.dotc.core.TyperState.commit(TyperState.scala:135) at dotty.tools.dotc.typer.Implicits.op$12(Implicits.scala:737) at dotty.tools.dotc.typer.Implicits.op$2(Implicits.scala:732) at dotty.tools.dotc.typer.Implicits.inferImplicit(Implicits.scala:728) at dotty.tools.dotc.typer.Implicits.inferImplicitArg(Implicits.scala:615) at dotty.tools.dotc.typer.Typer.implicitArgs$2(Typer.scala:2020) at dotty.tools.dotc.typer.Typer.implicitArgs$2(Typer.scala:2030) at dotty.tools.dotc.typer.Typer.addImplicitArgs$1(Typer.scala:2033) at dotty.tools.dotc.typer.Typer.adaptNoArgsImplicitMethod$2(Typer.scala:2085) at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:2201) at dotty.tools.dotc.typer.Typer.adaptInterpolated(Typer.scala:2346) at dotty.tools.dotc.typer.Typer.adaptInterpolated(Typer.scala:2335) at dotty.tools.dotc.typer.Typer.op$82(Typer.scala:1872) at dotty.tools.dotc.typer.Typer.op$42(Typer.scala:1868) at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:1867) at dotty.tools.dotc.typer.Typer.op$40(Typer.scala:1706) at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1702) ....
1 parent f3b9384 commit 0f54971

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

build.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ lazy val core = crossProject
157157
"org.typelevel" %%% "cats-core" % CatsVersion,
158158
"org.typelevel" %%% "cats-free" % CatsVersion,
159159
"org.scalaz" %%% "scalaz-core" % ScalazVersion,
160+
"ch.epfl.lamp" %% "dotty-library" % "0.5.0-bin-SNAPSHOT-nonbootstrapped",
160161

161162
"com.chuusai" %%% "shapeless" % "2.3.2",
162163

@@ -169,6 +170,10 @@ lazy val coreJS = core.js
169170

170171
lazy val dottyThing = project
171172
.dependsOn(coreJVM)
173+
.settings(
174+
projectDependencies ~= (_.map(_.withDottyCompat())),
175+
scalaVersion := "0.5.0-bin-SNAPSHOT"
176+
)
172177

173178
enablePlugins(GitVersioning)
174179

core/src/main/scala/shims/util/nsub.scala renamed to core/src/main/scala/shims/util/package.scala

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
package shims.util
17+
package shims
1818

19-
import scala.annotation.implicitNotFound
20-
21-
@implicitNotFound("unable to prove that $A is NOT a subtype of $B (likely because it actually is)")
22-
sealed trait </<[A, B]
23-
24-
private[util] trait NSubLowPriorityImplicits {
25-
implicit def universal[A, B]: A </< B = null
26-
}
27-
28-
object </< extends NSubLowPriorityImplicits {
29-
implicit def lie1[A, B](implicit ev: A <:< B): A </< B = null
30-
implicit def lie2[A, B](implicit ev: A <:< B): A </< B = null
19+
package object util {
20+
type </<[A, B] = scala.implicits.Not[A <:< B]
3121
}

project/plugins.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
2424
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "0.5.0")
2525

2626
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.14")
27+
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.1.6")

0 commit comments

Comments
 (0)