Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions vlib/v/ast/types.v
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,12 @@ pub fn (t Type) clear_flags(flags ...TypeFlag) Type {
}
}

// clear_ref clear refs of type
@[inline]
pub fn (t Type) clear_ref() Type {
return t & ~0x00FF_0000
}

// clear option and result flags
@[inline]
pub fn (t Type) clear_option_and_result() Type {
Expand Down
2 changes: 1 addition & 1 deletion vlib/v/checker/fn.v
Original file line number Diff line number Diff line change
Expand Up @@ -2305,7 +2305,7 @@ fn (mut c Checker) method_call(mut node ast.CallExpr, mut continue_check &bool)
c.error('interface `${iname}` does not have a .str() method. Use typeof() instead',
node.pos)
}
node.receiver_type = left_type
node.receiver_type = left_type.clear_ref()
node.return_type = ast.string_type
if node.args.len > 0 {
c.error('.str() method calls should have no arguments', node.pos)
Expand Down
Loading