Skip to content

Commit

Permalink
fix 2 test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tribbloid committed Jan 31, 2024
1 parent 13ec674 commit 5beb0e3
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ trait SplainFormattingExtension extends typechecker.splain.SplainFormatting with
lazy val broken: BrokenType = {

val Seq(_ll, _rr) = Seq(ll, rr).map { v =>
v.indent.indent.indent.indent.indent.joinLines.stripLeading()
v.indent.indent.indent.indent.indent.joinLines.trim
}

val result =
Expand Down
23 changes: 0 additions & 23 deletions core/src/test/resources/splain/plugin/ZIOSpec/console/code.scala

This file was deleted.

Empty file.
26 changes: 26 additions & 0 deletions core/src/test/resources/splain/plugin/ZIOSpec/source3/code.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import zio.*
import zio.console.Console

object source3 {

object Server {
type Pizza
type Broccoli

val start: ZIO[Console & Broccoli, Nothing, Unit] = {
val handler = (ServiceImpl.foo _).tupled
handler("blah", 1).unit
}
}

import Server.*

trait Service[-R] {
def foo(s: String, i: Int): ZIO[R, Nothing, String]
}

object ServiceImpl extends Service[Console & Pizza] {
def foo(s: String, i: Int) =
zio.console.putStrLn("blah").orDie.as("")
}
}
14 changes: 14 additions & 0 deletions core/src/test/resources/splain/plugin/ZIOSpec/source3/error
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
newSource1.scala:12: error: type mismatch;
zio.ZIO[
source3.Server.Pizza┃source3.Server.Broccoli with
zio.Has[zio.console.Console.Service],
Nothing,
Unit
]
handler("blah", 1).unit
^
newSource1.scala:23: error: under -Xsource:3, inferred zio.ZIO[zio.console.Console with source3.Server.Pizza,Nothing,String] instead of zio.ZIO[zio.console.Console,Nothing,String] [quickfixable]
Scala 3 migration messages are errors under -Xsource:3. Use -Wconf / @nowarn to filter them or add -Xmigration to demote them to warnings.
Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=scala3-migration, site=source3.ServiceImpl.foo
def foo(s: String, i: Int) =
^
2 changes: 1 addition & 1 deletion core/src/test/scala/splain/plugin/ZIOSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ZIOSpec extends SpecBase.File {
checkError()
}

check("console", profile = Profile.Splain("-Xsource:3")) {
check("source3", profile = Profile.Splain("-Xsource:3")) {
checkError()
}
}

0 comments on commit 5beb0e3

Please sign in to comment.