Apply suggestions from code review

pull/13718/head
Delyan Angelov 2022-03-23 08:05:26 +02:00 committed by GitHub
parent 830932e403
commit 03a64bce12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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)
}