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
tmp/v_1000/mvtodolist.17075409489401821847.tmp.c:23730: error: field not found: len
which correspond to
Reproduction Steps
run the file
import db.pg
struct Member{
id int @[primary]
children ?[]Child @[fkey:parent_id]
}
struct Child{
id int @[primary]
parent_id int
}
fn main() {
db := pg.connect(pg.Config{
host: 'localhost'
user: 'meveo'
password: 'meveo'
dbname: 'meveo'
}) or {
println('failed to connect')
println(err)
return
}
sql db { create table Member } or {
println(err)
}
new_member := Member{
id: 1
children: [Child{
id: 1
parent_id: 1
}]
}
sql db { insert new_member into Member}!
}
Expected Behavior
either no error or an error at compilation time telling the ? should not be used with array of entities
Current Behavior
builder error :
$ v run testBug.v
==================
/tmp/v_1000/testBug.6130289918847203090.tmp.c:18224: error: field not found: len
...
==================
(Use `v -cg` to print the entire error message)
builder error:
==================
C error. This should never happen
Describe the bug
When having an entity that has a list of child, like
the build process throw the error
which correspond to
![image](https://private-user-images.githubusercontent.com/16659140/286058150-987b9a1b-2d93-408c-a2a6-ba0466cfe029.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMDAxMTksIm5iZiI6MTczOTE5OTgxOSwicGF0aCI6Ii8xNjY1OTE0MC8yODYwNTgxNTAtOTg3YjlhMWItMmQ5My00MDhjLWEyYTYtYmEwNDY2Y2ZlMDI5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDE1MDMzOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ5OWZhYmUzNzIxY2M4Mzg3NjUwYjc0YmE0MjE4MDE3ZWFkZWNiNGViYjhhMzFkYmRlMTY3Mzg4MjY0Yjc5MGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.jeK3o2EGXdpNJ-41zEXjMAFjKnpVOw6hHSiLtKJ4cz8)
Reproduction Steps
run the file
Expected Behavior
either no error or an error at compilation time telling the ? should not be used with array of entities
Current Behavior
builder error :
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.3 b5ba122
Environment details (OS name and version, etc.)
ubuntu 22.04.2 in wsl2 (win 11)
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: