Skip to content

Issue 9631 - Error message not using fully qualified name (part 3)#7448

Merged
dlang-bot merged 1 commit intodlang:masterfrom
ntrel:qual-cast
Dec 20, 2017
Merged

Issue 9631 - Error message not using fully qualified name (part 3)#7448
dlang-bot merged 1 commit intodlang:masterfrom
ntrel:qual-cast

Conversation

@ntrel
Copy link
Copy Markdown
Contributor

@ntrel ntrel commented Dec 16, 2017

Disambiguate cast error messages.

@JinShil another follow up from #7405.

@ntrel ntrel requested a review from WalterBright as a code owner December 16, 2017 13:16
@dlang-bot
Copy link
Copy Markdown
Contributor

Thanks for your pull request, @ntrel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.

Some tips to help speed things up:

  • smaller, focused PRs are easier to review than big ones

  • try not to mix up refactoring or style changes with bug fixes or feature enhancements

  • provide helpful commit messages explaining the rationale behind each change

Bear in mind that large or tricky changes may require multiple rounds of review and revision.

Please see CONTRIBUTING.md for more information.

Bugzilla references

Auto-close Bugzilla Description
9631 Error message not using fully qualified name when appropriate.


tem!().S[1] at;
S[1] af = cast(S[1])at;
auto st = cast(tem!().S[])af;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cast(tem!().S[])(af[])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, you probably want to fix the error message on line 1590 as well: https://github.com/ntrel/dmd/blob/4e86c34dbb0e2032d0dd55bbc30062b9950475dc/src/dmd/dcast.d#L1590

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using af[] doesn't cause an error.

The sizes don't line up error only happens when if (tob.ty == Tarray && t1b.ty == Tsarray) is hit, a few lines before, which IIUC would mean toChars is never the same for each type (one is a static array, one not), so a fix is redundant.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or this simple toAutoQualChars fix is redundant rather. It would be good to show the qualification for S[1] vs S[] too, but I'm not sure how to best to do that. Same goes for S() and S, expression vs type, toChars is different.

@dlang-bot dlang-bot merged commit 97e51d1 into dlang:master Dec 20, 2017
@ntrel ntrel deleted the qual-cast branch December 22, 2017 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants