Apply suggestions from code review
parent
830932e403
commit
03a64bce12
|
|
@ -1,6 +1,6 @@
|
|||
vlib/v/checker/tests/generic_parameter_on_method.vv:15:15: error: cannot use `&Type<int>` as `Type<>` in argument 1 to `ConatinerType<int>.contains`
|
||||
vlib/v/checker/tests/generic_parameter_on_method.vv:15:15: error: cannot use `&Type<int>` as `Type<>` in argument 1 to `ContainerType<int>.contains`
|
||||
13 | fn main() {
|
||||
14 | con := ConatinerType<int>{typ: &Type<int>{0}}
|
||||
14 | con := ContainerType<int>{typ: &Type<int>{0}}
|
||||
15 | con.contains(con.typ)
|
||||
| ~~~~~~~
|
||||
16 | println(con)
|
||||
|
|
|
|||
|
|
@ -2,16 +2,16 @@ struct Type<T> {
|
|||
value T
|
||||
}
|
||||
|
||||
struct ConatinerType<T> {
|
||||
struct ContainerType<T> {
|
||||
typ &Type<T>
|
||||
}
|
||||
|
||||
fn (instance &ConatinerType<T>) contains(typ Type<T>) {
|
||||
fn (instance &ContainerType<T>) contains(typ Type<T>) {
|
||||
println(typ)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
con := ConatinerType<int>{typ: &Type<int>{0}}
|
||||
con := ContainerType<int>{typ: &Type<int>{0}}
|
||||
con.contains(con.typ)
|
||||
println(con)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue