roc icon indicating copy to clipboard operation
roc copied to clipboard

roc test crash when using |>

Open lukewilliamboswell opened this issue 3 years ago • 1 comments

This may be the intended behaviour. It gives an EXPECT PANICKED and a crash report that is difficult to interpret. Maybe this just needs a nicer error printed out?

# Passes
expect "SomeString" == Str.concat "Some" "String"
expect "SomeString" == ("Some" |> Str.concat "String")

# Crashes with "Hit an erroneous type when creating a layout for `5.IdentId(7)`"
expect "SomeString" == "Some" |> Str.concat "String"

lukewilliamboswell avatar Oct 08 '22 00:10 lukewilliamboswell

Yeah, we need a better error here. This parses as

expect ("SomeString" == "Some" |> Str.concat) "String"

which leads to a type error that then doesn't get printed out well.

ayazhafiz avatar Oct 08 '22 23:10 ayazhafiz

This issue has been resolved.

lukewilliamboswell avatar Dec 13 '22 07:12 lukewilliamboswell