You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
structFoo {
str string
}
// fn (f Foo) foo(f2 Foo) string { // would work, since no autoref when not mut?// fn (f &Foo) foo(f2 Foo) string { // same errorfn (mut f Foo) foo(f2 Foo) string {
returnif f.str !='' { f } else { f2 }.str
// return if f.str != '' { *f } else { f2 }.str // currently a manual deref is required
}
fnmain() {
mutfoo:= Foo{}
dump(foo.foo(Foo{str: 'a'}))
}
Reproduction Steps
above
Expected Behavior
works
Current Behavior
error: type mismatch in conditional expression (have 'struct main__Foo *' and 'struct main__Foo')
...
builder error:
==================
C error. This should never happen.
Possible Solution
No response
Additional Information/Context
No response
V version
v0.4.5
Environment details (OS name and version, etc.)
linux amd-x64
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.
The text was updated successfully, but these errors were encountered:
ttytm
added
the
Bug
This tag is applied to issues which reports bugs.
label
Apr 18, 2024
Describe the bug
Reproduction Steps
above
Expected Behavior
works
Current Behavior
Possible Solution
No response
Additional Information/Context
No response
V version
v0.4.5
Environment details (OS name and version, etc.)
linux amd-x64
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.
The text was updated successfully, but these errors were encountered: