-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
C builder error #19458
Comments
Yes, V should give a nicer error message for this. However, you definitely have an error in your code. You never set up the |
This code is only a reduced version of a functional code, on my project it only breaks when I add [direct_array_access] but without, it runs perfectly fine (because I have things in my array and stuff) but there it isn't executed but still outputs an error (and in my actual code it outputs an errror before anything gets executed) (This code is only a minimum reproduction of the bug). |
if use the code below, it outputs errors.
errors:
see error below
|
With your code, I dont get the same amout of errors as you.
|
struct Bar {
mut:
f []fn (f64) f64
}
// without [direct_array_access], the code is working.
[direct_array_access]
fn (b Bar) foo() {
b.f[0](0)
}
fn add_one(n f64) f64 {
println('numis: ${n}\naddoneis: ${n + 1}')
return n + 1
}
fn main() {
mut bar := Bar{}
bar.f << add_one
bar.foo()
}
PS D:\Test\v\tt1> v run .
numis: 0.0
addoneis: 1.0 |
@yuyi98 I try your code, it's work. You are right. |
Describe the bug
It outputs a c error when I run it (but in my actual code, without the [direct_array_access] it works perfectly fine.
Reproduction Steps
Current Behavior
V version
V 0.4.1 8f69bd1
Environment details (OS name and version, etc.)
PS C:\Users\PACHECON_cv\spartlink_nns> v doctor
V full version: V 0.4.1 7bfb35d.8f69bd1
OS: windows, Microsoft Windows 10 ducation v19045 64 bits
Note
You can vote for this issue using the 👍 reaction. More votes increase the issue's priority for developers.
Take into account that only the 👍 reaction counts as a vote.
Only reactions to the issue itself will be counted as votes, not comments.
The text was updated successfully, but these errors were encountered: