Skip to content

Conversation

@jacob-carlborg
Copy link
Contributor

The message is constructed on demand to be able to have the constructor pure and formatting the message in an impure way.

Extracted from #9480.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @jacob-carlborg! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + dmd#9494"

@thewilsonator
Copy link
Contributor

dsymbol/src/dsymbol/symbol.d(204): Deprecation: Cannot use `alias this` to partially initialize variable `part` of type `SymbolOwnership`. Use `part.ptr`

@wilzbach
Copy link
Contributor

No, the error is:

dmd/errors.d(77:24)[warn]: Useless final attribute, private functions declared within a class are never virtual

@jacob-carlborg
Copy link
Contributor Author

Sounds more reasonable. Will fix

@jacob-carlborg
Copy link
Contributor Author

Fixed.

@WalterBright
Copy link
Member

I want to put a hold on all this refactoring. I do not agree with the premise of it, and would like to revert #9350

I do not understand the value in adding hundreds and hundreds of lines of code that do next to nothing. What problem is it solving?

@jacob-carlborg
Copy link
Contributor Author

#9350 (comment)

@jacob-carlborg
Copy link
Contributor Author

#9480 (comment)

The message is constructed on demand to be able to have the
constructor pure and formatting the message in an impure way.
@wilzbach
Copy link
Contributor

Rebased to upstream/master fix CircleCi.

@WalterBright
Copy link
Member

Not doing this, for reasons explained elsewhere.

@jacob-carlborg
Copy link
Contributor Author

By collecting all the diagnostics, instead of reporting them directly, and pushing up to the caller it will be possible to make the lexer pure. That means it no longer relies global state meaning it increases encapsulation.

@adamdruppe
Copy link
Contributor

One thing I would really like long term is for all errors to be jam-packed with useful semantic information, such that they can be formatted in different contexts to best highlight that. (This is what I really mean when I say "xml error messages" on the forum, etc.)

I actually think something like this is the logical first start: error messages represented not as strings, but as objects. It just wraps a string for now, but ultimately if this leads to those input strings all being eliminated (it can still output those strings though, but the input should put the details in more structure), I'd see it as being a good thing.

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.

6 participants