Skip to content
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

Issue 11317 - glue.c:1218: virtual unsigned int Type::totym(): Assertion `0' failed. #2763

Closed
wants to merge 1 commit into from

Conversation

yebblies
Copy link
Member

The result of inferring auto-refness is discarded, it should be retained and used by the glue layer when deciding whether to take the address of the expression or not.

https://d.puremagic.com/issues/show_bug.cgi?id=11317

@9rnsr
Copy link
Contributor

9rnsr commented Nov 14, 2013

This is not good fix. The root cause is that currently return type inference and ref-ness deduction are not correctly separated. For example, following code should be rejected in front-end.

void main() {
    auto ref uint fun() {
        return 0;
    }
    void test(ref uint x) {}
    test(fun());
}

@yebblies
Copy link
Member Author

Haha thanks, I just realized this while looking at https://d.puremagic.com/issues/show_bug.cgi?id=11322

As far as I can tell, the function type's isref is being rewritten somewhere else... this obviously isn't good.

@yebblies yebblies closed this Nov 14, 2013
@9rnsr
Copy link
Contributor

9rnsr commented Nov 14, 2013

I opened #2766.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants