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

Issue 11819 - Implement better diagnostics for unrecognized traits. #3507

Merged
merged 1 commit into from Apr 28, 2014
Merged

Issue 11819 - Implement better diagnostics for unrecognized traits. #3507

merged 1 commit into from Apr 28, 2014

Conversation

ghost
Copy link

@ghost ghost commented Apr 28, 2014

https://issues.dlang.org/show_bug.cgi?id=11819

I wish I could avoid duplicating the list of traits with the ones in the msgtable in idgen.c, and that I could avoid hardcoding 39 but I want to keep DDMD compatibility.

But any improvement tips are always welcome!

@yebblies
Copy link
Member

Instead of using a hardcoded number, you can put a NULL sentinel at the end.

You could also do it with a linear search instead of a string table. I 39 items in a very specific error message is going to be a performance bottleneck, and then you could get rid of the init method.

The number of errors doesn't match up with the number of traits invocations, do you need to split it to get the full error list?

@yebblies
Copy link
Member

You could also do it with a linear search instead of a string table. I 39 items in a very specific error message is going to be a performance bottleneck, and then you could get rid of the init method.

I just remembered that speller calls that method 1000s of times. Maybe a hash table is worthwhile after all.

@ghost
Copy link
Author

ghost commented Apr 28, 2014

The number of errors doesn't match up with the number of traits invocations, do you need to split it to get the full error list?

Oops, I didn't realize the limit was getting reached. Will fixup.

@ghost
Copy link
Author

ghost commented Apr 28, 2014

Updated.

@ghost
Copy link
Author

ghost commented Apr 28, 2014

I just remembered that speller calls that method 1000s of times. Maybe a hash table is worthwhile after all.

Yeah it definitely calls it a lot of times.

@yebblies
Copy link
Member

Looks good

@yebblies
Copy link
Member

Auto-merge toggled on

yebblies added a commit that referenced this pull request Apr 28, 2014
Issue 11819 - Implement better diagnostics for unrecognized traits.
@yebblies yebblies merged commit 36d64b3 into dlang:master Apr 28, 2014
ibuclaw pushed a commit to ibuclaw/dmd that referenced this pull request Jul 10, 2022
Add `return` to moduleinfo methods returning `this`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants