Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsuppress ChangeType errors #545

Open
wants to merge 3 commits into
base: develop-2.0
Choose a base branch
from

Conversation

ewoutkramer
Copy link
Member

@ewoutkramer ewoutkramer commented Sep 16, 2024

I noticed that we had repeated code for handling what happens when ChangeType returns TypeConversion.NoMatch. We are mostly throwing (variations) of NewExpressionBuildingException, so I refactored a bit to make ChangeType throw a consistent error, using the throwOnError techique that we used elsewhere.

Then, I noticed this code:

  // If we make this a hard fail, 15 unit tests fail.
                        // throw this.NewExpressionBuildingException(
                        //      $"Cannot convert {expression.Type.ToCSharpString(Defaults.TypeCSharpFormat)} to {tsType.ToCSharpString(Defaults.TypeCSharpFormat)}");
                    

So, we actually had 15 unit tests failing, but their failure was turned into a line in a log file. Sure enough, when I uncommented this, I got 15 (well, really 16) unit tests failing.

I was able to fix 14 out of sixteen (but see #543) cases, which left two, which are covered under #519 and #543. For now, I have suppressed these last two again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant