-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Issue 2950 - Allow switch on enum of string base type. #1358
Conversation
| @@ -0,0 +1,19 @@ | |||
| enum E : string { a = "first", b = "second", c = "third" } | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trouble with adding a separate file for each test is it tremendously increases the time necessary to run the test suite. Please instead add it to one of the other test files, which adds very little to the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having too few test files can also be problematic, though, as it decreases the granularity of the status reports if the test suite does not pass. For DMD, this might not be as big a concern, as the test suite is developed in synchrony with it anyway. If you are working on an alternative implementation/port, though, it can be quite annoying if a big test case fails, and you can't quickly judge the scope of the breakage. I'm not sure what the best compromise here is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the time it takes the full test suite to run is a significant bottleneck.
I've been doing this style for a long time, and having a few files filled with large numbers of tests works out pretty good.
|
Moved the test-case into |
|
Rebased, waiting for review and green. |
|
Superseded by #2080. |
|
Apologies for the duplicated work! |
|
Not necessary, his pull was better :) (and the -g switch works with his pull, although I'm not sure whether it's related to the pull). |
http://d.puremagic.com/issues/show_bug.cgi?id=2950
This is only a partial fix since this won't compile with the
-gswitch. WhenEnumDeclaration::toDebugis called, it callscv4_Denumwhich expects the enum to have an integer base type. It tries to calltoIntegermethod on the enum declaration.cv4_Denumis a very complicated function, I don't know how to implement a fix there.