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

TypeInfo for interface gives invalid string for name #3693

Closed
schveiguy opened this issue Apr 3, 2021 · 7 comments
Closed

TypeInfo for interface gives invalid string for name #3693

schveiguy opened this issue Apr 3, 2021 · 7 comments

Comments

@schveiguy
Copy link
Contributor

In the latest release (1.25.1), using typeid(SomeInterface) gives a TypeInfo_Interface that has a null name, and very incorrect length.

e.g.:

import std.stdio;

interface I {}
void main() {
    auto n = typeid(I).toString;
    writeln(n.ptr, " ", n.length);
}

output on my system:

null 94194140254384
@schveiguy
Copy link
Contributor Author

Note, I tested with 1.24.0 and it does not have this problem.

@schveiguy
Copy link
Contributor Author

Looks like the info member is actually pointing back at itself instead of the embedded class.

Two screenshots from godbolt:

Screen Shot 2021-04-03 at 12 11 09 PM
Screen Shot 2021-04-03 at 12 11 18 PM

@kinke
Copy link
Member

kinke commented Apr 4, 2021

Fixed in 0d7d776.

@schveiguy
Copy link
Contributor Author

When will this be released? I don't know when godbolt updates their "latest CI" version, so I'm not sure if this build includes the fix. I know that 1.25.1 does not.

The commit says it doesn't belong to any branch. What does that mean? Master doesn't seem to have this fix included.

@kinke
Copy link
Member

kinke commented Apr 4, 2021

It's part of #3678 & will be in the next beta, scheduled to be released soon.

@schveiguy
Copy link
Contributor Author

OK, thanks!

@kinke
Copy link
Member

kinke commented Apr 10, 2021

It's in master now.

@kinke kinke closed this as completed Apr 10, 2021
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

No branches or pull requests

2 participants