If I run this program:
On the VM, it throws a TypeError (which is also a CastError). On DDC, it throws a NoSuchMethod Error. The language spec is agnostic as to the concrete error type, but I think it's good for our users if the implementations agree. Pragmatically, I'm trying to migrate some affected tests that validate the exception type being thrown, and I'd like them to check for a specific type and not consider the test to pass if any old error is thrown.
My preference is for ! to always throw a TypeError. I don't think NoSuchMethodError makes much sense because the user hasn't actually tried to call a method. Unless I hear otherwise, I'll have the tests to look for TypeError and approve the DDC failure with a link to this issue.
cc @leafpetersen in case he has an opinion.
If I run this program:
On the VM, it throws a TypeError (which is also a CastError). On DDC, it throws a NoSuchMethod Error. The language spec is agnostic as to the concrete error type, but I think it's good for our users if the implementations agree. Pragmatically, I'm trying to migrate some affected tests that validate the exception type being thrown, and I'd like them to check for a specific type and not consider the test to pass if any old error is thrown.
My preference is for
!to always throw a TypeError. I don't think NoSuchMethodError makes much sense because the user hasn't actually tried to call a method. Unless I hear otherwise, I'll have the tests to look for TypeError and approve the DDC failure with a link to this issue.cc @leafpetersen in case he has an opinion.