mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: support typeof(x).idx, as well as iface.type_idx() (#11178)
This commit is contained in:
@@ -514,8 +514,8 @@ fn (mut p Parser) interface_decl() ast.InterfaceDecl {
|
||||
line_nr := p.tok.line_nr
|
||||
name := p.check_name()
|
||||
|
||||
if name == 'type_name' {
|
||||
p.error_with_pos('cannot override built-in method `type_name`', method_start_pos)
|
||||
if name in ['type_name', 'type_idx'] {
|
||||
p.error_with_pos('cannot override built-in method `$name`', method_start_pos)
|
||||
return ast.InterfaceDecl{}
|
||||
}
|
||||
if ts.has_method(name) {
|
||||
|
||||
Reference in New Issue
Block a user