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 c39ca86 commit 61a6c04
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.watcherExclude": {
"**/target": true
}
}
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ hasn't been figure out, or is it because the code that references the specific
- [ ] 047 CyclicReferenceInvolvingImplicitID - See notes in the file
- [ ] 054 ParameterizedTypeLacksArgumentsID
- [ ] 059 DoesNotConformToSelfTypeCantBeInstantiated
- [ ] 061 TopLevelCantBeImplicitID

## Getting Started

Expand Down
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 61a6c04

Please sign in to comment.