It would be very helpful if we could do something like:
new TypeBuilder('StateError').newInstance(['Blah blah blah']).asThrow();
This would also work, and might be better than the original suggestion I had:
I have a branch where this change is implemented as an asThrow method on ExpressionBuilder instances, but it wouldn't be difficult for me to just expose the _ThrowExpression class I created.
Thoughts on this? Can I go ahead and submit a PR, or was I too vague and need to clarify?
Thanks in advance.