Many expects look like expect x == y. When the test fails, it's usually useful to know what the actual values are, if they are safe to inspect. It would be nice to display a message like Expected x == y, but x == 42, and y == 43.
I vaguely remember this being the case in the old compiler, so perhaps this has been discussed before and you decided that adding dbg x and dbg y wasn't a big deal? That said, we don't always have access to the code where the expect lives, such as in Exercism.
If we do go ahead with this, then we'd need the same thing for <=, >=, !=, and perhaps a few more common use cases.
yeah it just hasn't been implemented yet
the actual thing I want to do is to break down the entire expression and show all the subexpressions, as well as all the identifiers that were used in it
so like if you do
expect foo.bar().baz().is_thing(blah)
then it would print something like:
foo == 42
foo.bar() == "something"
foo.bar().baz() == 123
blah == "stuff"
foo.bar().baz().is_thing(blah) == False
so operators like == wouldn't be special-cased at all, it would just give you all the info so a lot of the time you don't have to go back and dbg things
Even better! ![]()
yeah just haven't done it yet :laughing:
Last updated: Sep 03 2026 at 15:16 UTC