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

std::core::has_member fails for this and parent. #109

Open
paxcut opened this issue May 24, 2024 · 0 comments
Open

std::core::has_member fails for this and parent. #109

paxcut opened this issue May 24, 2024 · 0 comments

Comments

@paxcut
Copy link
Contributor

paxcut commented May 24, 2024

Try running the following simple pattern:

import std.core;
import std.io;
using Test;

struct Parent {
    Test test;
    u8 byte;
    std::print("{}",std::core::has_member(this,"test"));
};

Parent p @0;

struct Test {
    u8 var;
    auto local = parent;
    std::print("{}",local);
    std::print("{}",std::core::has_member(this,"var"));
   std::print("{}",std::core::has_member(parent,"byte"));
};

std::print("{}",std::core::has_member(p,"test"));

This prints false for all but the last print statement.
I also don't understand why local appears to be empty no matter what I try.

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

1 participant