1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tests: add test for fix #cf7b45b

This commit is contained in:
joe-conigliaro 2020-12-04 15:43:28 +11:00
parent da1c361cfe
commit b578e60dd5
No known key found for this signature in database
GPG Key ID: C12F7136C08206F1
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,15 @@
module main
import shapes { Point, Line }
// test that Point & Line work correctly
// with struct init & array's
fn test_imported_symbols() {
p0 := Point {x: 10 y: 10}
p1 := Point {x: 50 y: 10}
_ := Line {
ps: [p0, p1]
}
}

View File

@ -0,0 +1,12 @@
module shapes
pub struct Point {
pub mut:
x int
y int
}
pub struct Line {
pub mut:
ps []Point
}