Skip to content

Comments

Allow classes and interfaces with only static members to be used in -betterC#8324

Closed
JinShil wants to merge 1 commit intodlang:masterfrom
JinShil:betterc_classes
Closed

Allow classes and interfaces with only static members to be used in -betterC#8324
JinShil wants to merge 1 commit intodlang:masterfrom
JinShil:betterc_classes

Conversation

@JinShil
Copy link
Contributor

@JinShil JinShil commented Jun 2, 2018

This is a followup to #8204, but for -betterC.

dlang/druntime#2194 was merged, which prevents -betterC from importing symbols that -betterC cannot utilize. This means the logic added for #8204 can now be utilized for -betterC builds as well.

However, with -betterC builds, object.d is still imported and parsed in its entirety; TypeInfo, ModuleInfo, and other unsupported features are just versioned out. Therefore, I had to move the logic for setting the special ClassDeclarations, out of the parsing phase and into the symbol semantic phase.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @JinShil!

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#8324"

@JinShil JinShil added Review:WIP Work In Progress - not ready for review or pulling Review:Vision Vision Plan https://wiki.dlang.org/Vision/2018H1 labels Jun 2, 2018
m.dsymbolSemantic(null);
}

backend_init();
Copy link
Contributor Author

@JinShil JinShil Jun 3, 2018

Choose a reason for hiding this comment

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

The backend is dependent on whether Throwable is declared, so we have to move its initialization until after dsymbolSemantic.

@JinShil
Copy link
Contributor Author

JinShil commented Jun 3, 2018

Gah! This is not going to work if we want to allow using TypeInfo at compile-time. https://issues.dlang.org/show_bug.cgi?id=18472

I think if we had a version(CTFE) feature, it could be done, but until then, I'm giving up on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review:Vision Vision Plan https://wiki.dlang.org/Vision/2018H1 Review:WIP Work In Progress - not ready for review or pulling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants