Describe the bug
Using map(try(s)) for some strategy s will not report a cast insertion, even if there is a cast inserted. This is unlike filter(s), which seems to behave differently and may not even insert a cast.
signature
sorts Test
constructors
Foo : Test
Bar : Test
rules
run = ![Foo(), Bar()]; issue
issue :: List(Test) -> ?
issue = map(try(do-something-with-bar)) // fails, no cast message
// issue = filter(do-something-with-bar) // succeeds, no cast message (and seemingly no cast needed)
do-something-with-bar: Bar() -> ()
with debug(!"Got a bar: ")
Observed behaviour
Exception during evaluation: Cannot cast the following term from Tuple to Test:
()
Expected behaviour
Ideally, this succeeds as this is perfectly fine in Stratego 1. If that is not possible, a message that a cast is being inserted in the map(try(s)).
Describe the bug Using
map(try(s))
for some strategys
will not report a cast insertion, even if there is a cast inserted. This is unlikefilter(s)
, which seems to behave differently and may not even insert a cast.Project Used inside a Spoofax 3 source project.
Versions metaborg/devenv@fe137453e62d61da3e1e5b172b6659f038815aa0
To Reproduce
Observed behaviour
Expected behaviour Ideally, this succeeds as this is perfectly fine in Stratego 1. If that is not possible, a message that a cast is being inserted in the map(try(s)).