generics: fix method calls
parent
e89ae7e194
commit
4988d340b1
|
@ -701,7 +701,7 @@ pub fn (mut c Checker) call_expr(mut call_expr ast.CallExpr) table.Type {
|
||||||
pub fn (mut c Checker) call_method(mut call_expr ast.CallExpr) table.Type {
|
pub fn (mut c Checker) call_method(mut call_expr ast.CallExpr) table.Type {
|
||||||
left_type := c.expr(call_expr.left)
|
left_type := c.expr(call_expr.left)
|
||||||
call_expr.left_type = left_type
|
call_expr.left_type = left_type
|
||||||
left_type_sym := c.table.get_type_symbol(left_type)
|
left_type_sym := c.table.get_type_symbol(c.unwrap_generic(left_type))
|
||||||
method_name := call_expr.name
|
method_name := call_expr.name
|
||||||
// TODO: remove this for actual methods, use only for compiler magic
|
// TODO: remove this for actual methods, use only for compiler magic
|
||||||
// FIXME: Argument count != 1 will break these
|
// FIXME: Argument count != 1 will break these
|
||||||
|
|
|
@ -56,6 +56,12 @@ mut:
|
||||||
foo string
|
foo string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn (u User) init() {
|
||||||
|
}
|
||||||
|
|
||||||
|
fn (c City) init() {
|
||||||
|
}
|
||||||
|
|
||||||
fn test_create() {
|
fn test_create() {
|
||||||
create<User>()
|
create<User>()
|
||||||
create<City>()
|
create<City>()
|
||||||
|
@ -204,5 +210,4 @@ fn test_generic_fn_with_variadics(){
|
||||||
p(abc)
|
p(abc)
|
||||||
p('Good','morning','world')
|
p('Good','morning','world')
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue