Skip to content

Commit

Permalink
fead: add in 061
Browse files Browse the repository at this point in the history
Adding `// LEGACY` to 061.
It seems like TopLevelCantBeImplicit is no longer the case thanks to
scala/scala3#5754

This is actually confirmed in https://github.com/lampepfl/dotty/blob/93fc41fcb624df73cc12d52b79d518a30a778a7c/tests/run/toplevel-implicits/a.b.scala#L19-L21
  • Loading branch information
tanishiking committed Apr 14, 2022
1 parent d68823e commit 8151e96
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions examples/061_TopLevelCantBeImplicitID.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// I can't seem to reproduce this one. I see in `Checking.scala` that is should
// be it if sym.owner.is(Package), but when playing around that doesn't seem to
// ever be true
// INCOMPLETE
// LEGACY In the past top level implicit were not allowed. This is however no longer the case as of https://github.com/lampepfl/dotty/pull/5754
// START
@main def TopLevelCantBeImplicitID = ()

import scala.language.implicitConversions
case class C(str: String)
implicit def toC(x: String): C = C(x)
implicit val defaultC: C = C("default")
// END

0 comments on commit 8151e96

Please sign in to comment.