File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
core/src/main/scala/sttp/monad Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
import com .softwaremill .SbtSoftwareMillBrowserTestJS ._
2
+ import com .typesafe .tools .mima .core ._
2
3
3
4
val scala2_11 = " 2.11.12"
4
5
val scala2_12 = " 2.12.13"
@@ -97,7 +98,13 @@ lazy val rootProject = (project in file("."))
97
98
98
99
lazy val core = (projectMatrix in file(" core" ))
99
100
.settings(
100
- name := " core"
101
+ name := " core" ,
102
+ mimaBinaryIssueFilters ++= {
103
+ if (scalaVersion.value == scala2_11) {
104
+ // excluding this for 2.11 as the `blocking` method will only ever be called in recompiled library code
105
+ Seq (ProblemFilters .exclude[ReversedMissingMethodProblem ](" sttp.monad.MonadError.blocking" ))
106
+ } else Nil
107
+ }
101
108
)
102
109
.jvmPlatform(
103
110
scalaVersions = scala2 ++ scala3,
Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ trait MonadError[F[_]] {
43
43
}
44
44
45
45
def ensure [T ](f : F [T ], e : => F [Unit ]): F [T ]
46
+
47
+ def blocking [T ](t : => T ): F [T ] = eval(t)
46
48
}
47
49
48
50
trait MonadAsyncError [F [_]] extends MonadError [F ] {
@@ -162,4 +164,6 @@ class FutureMonad(implicit ec: ExecutionContext) extends MonadAsyncError[Future]
162
164
}
163
165
p.future
164
166
}
167
+
168
+ override def blocking [T ](t : => T ): Future [T ] = Future (scala.concurrent.blocking(t))
165
169
}
You can’t perform that action at this time.
0 commit comments