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 T is $address #22792

Open
2 tasks
enghitalo opened this issue Nov 8, 2024 · 0 comments
Open
2 tasks

$if T is $address #22792

enghitalo opened this issue Nov 8, 2024 · 0 comments
Assignees
Labels
Feature Request This issue is made to request a feature.

Comments

@enghitalo
Copy link
Contributor

enghitalo commented Nov 8, 2024

Describe the feature

Verify if generic is pointer

Use Case

insert or write value from pointer

a := 5
b := &a

mut expected := false

$if b is $pointer {
    expected = true
} $else {
    expected = false
}

assert expected
mut a := 5
mut b := &a
mut c := &b

fn insert_value_in_pointer[T](mut pointer T) {
	$if b is $pointer {
		insert_value_in_pointer(*pointer)
	} $else {
		pointer = 10
	}
}

insert_value_in_pointer(c)

assert a == 10

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

latest

Environment details (OS name and version, etc.)

all

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Huly®: V_0.6-21238

@enghitalo enghitalo added the Feature Request This issue is made to request a feature. label Nov 8, 2024
@felipensp felipensp self-assigned this Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request This issue is made to request a feature.
Projects
None yet
Development

No branches or pull requests

2 participants