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
```scala mdoc
final case class Test(value: Int)
val test = Test(123)
test.value
```
```scala mdoc:fail
val x: Int = "123"
```
yields the following output with mdoc:
```scala
final case class Test(value: Int)
val test = Test(123)
// test: Test = Test(123)
test.value
// res0: Int = 123
```
```scala
val x: Int = "123"
// warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
// test.value
// ^^^^^^^^^^
// error: type mismatch;
// found : String("123")
// required: Int
// val x: Int = "123"
// ^^^^^
```
where the following warning is unexpected.
warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
test.value
^^^^^^^^^^
The text was updated successfully, but these errors were encountered:
Thanks for reporting! This issue is caused by the different compilation encoding used for :fail fences and default fences. In default fences, every statement is bound to a variable like
valres0= test.value
avoiding the error. We should do the same transformation for non-:fail blocks.
The following markdown document:
yields the following output with mdoc:
where the following warning is unexpected.
The text was updated successfully, but these errors were encountered: