Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checker: message when method not exists #20364

Closed
enghitalo opened this issue Jan 3, 2024 · 0 comments · Fixed by #20380
Closed

checker: message when method not exists #20364

enghitalo opened this issue Jan 3, 2024 · 0 comments · Fixed by #20380
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@enghitalo
Copy link
Contributor

enghitalo commented Jan 3, 2024

Describe the bug

Wrong message

Reproduction Steps

struct Builder[T] {
mut:
	buf T
}

pub fn new_builder[F](mut fixed_array F) !Builder[F] {
	$if F is $array_fixed {
		return Builder[F]{fixed_array}
	} $else {
		return error('fixed_buf need be a fixed array')
	}
}

fn main() {
	mut fixed := [3]u8{}
	mut sb := new_builder(mut fixed) or {
		eprintln(err)
		return
	}
	// println(sb)
	sb.write_string("")
}

Expected Behavior

e.v:21:5: error: unknown method or field: `Builder[[3]u8].write_string`
   19 |     }
   20 |     // println(sb)
   21 |     sb.write_string("")
      |        ~~~~~~~~~~~~~~~~
   22 | }
   23 |

or

e.v:21:5: error: unknown method or field: `Builder[F].write_string`
   19 |     }
   20 |     // println(sb)
   21 |     sb.write_string("")
      |        ~~~~~~~~~~~~~~~~
   22 | }
   23 |

Current Behavior

e.v:21:5: error: unknown method or field: `Builder<F>[[3]u8].write_string`
   19 |     }
   20 |     // println(sb)
   21 |     sb.write_string("")
      |        ~~~~~~~~~~~~~~~~
   22 | }
   23 |

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.3 bf7b29a

Environment details (OS name and version, etc.)

Ubuntu

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant