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
Expected behavior
Running the following command should allow the test to run successfully:
sbt test
Current behavior
When I run sbt test, the Example.scala file under test fails to compile with the following error:
[error] -- [E008] Not Found Error: /Users/valydia/Workspace/iron-not-working-in-test/src/test/scala/com/example/Example.scala:9:11
[error] 9 | MyLong.option(myLong)
[error] | ^^^^^^^^^^^^^
[error] |value option is not a member of object com.example.mytypes.MyLong, but could be made available as an extension method.
[error] |
[error] |The following import might make progress towards fixing the problem:
[error] |
[error] | import io.github.iltotore.iron.autoRefine
[error] |
[error] one error found
Workaround
If I copy the mytypes.scala file into the test directory, the tests run successfully.
The problem here is that you're using RefinedTypeOps.Transparent which is only for transparent (aka non-opaque) type aliases. Due to a compiler limitation, you have to use the more boilerplate-ish RefinedTypeOps[Long, Pure, MyLong].
FYI I'm working on a more concise newtipe definition in #253 for 3.0.0
Oh I see - I misunderstood - I thought somehow that RefinedTypeOps.Transparent was for New type with no constraint - Got it now - thanks for clarifying
Describe the bug
When I defined newtype with no constraint, I am not able to use the refinement method from the
test
directoryEnvironment
Reproduction steps
The structure of the project is as follows:
Both
Example.scala
files are identical and here is their content:And here is
mytypes
content:Here is a link to a reproducible example
Expected behavior
Running the following command should allow the test to run successfully:
sbt test
Current behavior
When I run
sbt test
, theExample.scala
file undertest
fails to compile with the following error:Workaround
mytypes.scala
file into thetest
directory, the tests run successfully.MyLong
as:The text was updated successfully, but these errors were encountered: