-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Move newScope
methods from dclass.d
to newScope visitor in dsymbolsem.d
#17038
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request and interest in making D better, @dchidindu5! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
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 referencesYour 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 locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#17038" |
Try rebasing on the most recent master, those failures don't immediately seem to be related. |
@thewilsonator |
compiler/src/dmd/dsymbolsem.d
Outdated
|
||
override void visit(ClassDeclaration cld) | ||
{ | ||
auto sc2 = cld.newScope(sc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you have translated super.newScope
here properly. Should be (cast(AggregateDeclaration)cld).newScope(sc);
compiler/src/dmd/dsymbolsem.d
Outdated
|
||
override void visit(InterfaceDeclaration ifd) | ||
{ | ||
auto sc2 = ifd.newScope(sc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same but `cast(ClassDeclaration)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, Let me work on them
@@ -234,6 +234,7 @@ void test_visitors() | |||
ClassDeclaration *cd = ClassDeclaration::create(loc, Identifier::idPool("TypeInfo"), NULL, NULL, true); | |||
assert(cd->isClassDeclaration() == cd); | |||
assert(cd->vtblOffset() == 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this assert failing means that
if (isCOMinterface() || isCPPinterface())
return 0;
return 1;
is returning the wrong value.
Both of those methods should return false
for class
es (i.e. only for interfaces should they possibly return true
). I'm not really sure why that is happening. You might want to check what the actual return value is. If it is 0
or if it is some other value (which would indicate a corrupt vtable on the C++ side).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is odd that is only happens with G++/MSVC(???) as the C++ compiler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay i'd look at the actual return value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thewilsonator I'm a bit lost here, how do I figure that out??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
printf("cd->vtblOffset() = %d\n", cd->vtblOffset());
OPEN SOURCE CONTRIBUTOR