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

if_ref not working for value types #393

Open
spiiin opened this issue Jan 23, 2023 · 1 comment
Open

if_ref not working for value types #393

spiiin opened this issue Jan 23, 2023 · 1 comment

Comments

@spiiin
Copy link

spiiin commented Jan 23, 2023

looks like if_ref/is_ref_value not working for value types

options log_infer_passes=true
[export]
def main
    var a: int
    var b: int& = a

    print("{typeinfo(typename type<int&>)}\n")
    print("{typeinfo(is_ref type<int&>)}\n")
    print("{typeinfo(is_ref_value type<int&>)}\n")
    print("{typeinfo(is_ref_type type<int&>)}\n")
    print("\n")
    print("{typeinfo(typename b)}\n")
    print("{typeinfo(is_ref b)}\n")
    print("{typeinfo(is_ref_value b)}\n")
    print("{typeinfo(is_ref_type b)}\n")

//Output:
int&
true
true
false

int
false
false
false
@borisbat
Copy link
Collaborator

its an interesting case. i need to think about it - because both behaviors for local refs are viable

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