You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a compilation issue in production code today that I couldn't explain, so I reduced it to a minimal case:
importcats.effect.IOobjectDeleteMe {
// I am using this - see: https://github.com/oleg-py/better-monadic-for// addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1")deftest_OK= {
for {
(a,b,c) <-IO.pure( (1,2,3) )
} yield a+b+c
}
deftest_bad= {
for {
(a, b, c) <-IO.pure(11).map{ _ =>valg=3// <--- Any binding here causes compile to fail
(1,2,3)
}
} yield a + b + c // compiler says 'not found' for each of these
}
}
Not sure if I am missing something, but adding that val binding causes the compile to fail, e.g.
[error] /x/DeleteMe.scala:21:13: not found: value a
[error] } yield a + b + c // compiler says 'not found' for each of these
[error] ^
[error] /x/DeleteMe.scala:21:17: not found: value b
[error] } yield a + b + c // compiler says 'not found' for each of these
[error] ^
[error] /x/DeleteMe.scala:21:21: not found: value c
[error] } yield a + b + c // compiler says 'not found' for each of these
[error] ^
[error] three errors found
The text was updated successfully, but these errors were encountered:
I had a compilation issue in production code today that I couldn't explain, so I reduced it to a minimal case:
Not sure if I am missing something, but adding that
val
binding causes the compile to fail, e.g.The text was updated successfully, but these errors were encountered: