Skip to content

Fix Issue 20626 - ICE when using typeof of unittest symbol without -u… #11145

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

Merged
merged 1 commit into from
May 15, 2020

Conversation

MoonlightSentinel
Copy link
Contributor

…nittest flag.

Not sure if this is the behaviour but the special unittest functions should not be used in user code anyway.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @MoonlightSentinel! 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 coverage diff by visiting the details link of the codecov check)
  • 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

Auto-close Bugzilla Severity Description
20626 regression ICE when using typeof of unittest symbol without -unittest flag

Testing this PR locally

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

dub run digger -- build "stable + dmd#11145"

@MoonlightSentinel
Copy link
Contributor Author

CC @Geod24

@Geod24
Copy link
Member

Geod24 commented May 15, 2020

This seems rather specialized, no ? I would look into what's happening with in / out contracts and perhaps invariant, to see if the problem is tied to unittest or not. It could be a general fwd ref error which triggers with all those maybe-instantiated symbols, or it could be something specific to unittest (since it's the only symbol that would not be parsed when unused, AFAIK).

@MoonlightSentinel
Copy link
Contributor Author

The problem here is that the UnitTestDeclaration is barely initialized because the unittest is ignored. That is different from contracts which are analyzed even if they are not used.

Anyhow, I'll add a test for ignored invariants.

@Geod24
Copy link
Member

Geod24 commented May 15, 2020

Thanks, LGTM

@dlang-bot dlang-bot merged commit 9921b6c into dlang:stable May 15, 2020
@UplinkCoder
Copy link
Member

This is a bit dubious.
There are deeper issues here.

@MoonlightSentinel MoonlightSentinel deleted the unit-seg branch June 20, 2021 19:58
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.

5 participants