'radius' is not a parameter in VB.NET

北城以北 提交于 2019-12-11 15:18:48

问题


Using a NuGet library Accord.net

Autocomplete shows a parameter:

radius:=

But when I finish the line to look like this:

 Dim result = tree.Nearest(tn.Position, radius:=3.1)

I get the error:

BC30272 'radius' is not a parameter of 'Public Overloads Function Nearest(position As Double(), neighbors As Integer) As KDTreeNodeCollection(Of KDTreeNode(Of KDTreeNode(Of Double)))'.

I've never run into this before. What could be the issue?


Edit: To answer questions in the comments: @GSerg asks:

It should be double, not decimal. Is Dim result = the actual code you are running, or do you in fact have a type declared for result? Does it call the correct overload if you don't provide the parameter name?

double vs decimal:

Dim result As KDTreeNodeCollection(Of KDTreeNode(Of Integer)) = tree.Nearest(query, Convert.ToDouble(2.00003))

The following does not work either:

    Dim query = New Double() {6, 6, 6}
    Dim radius As Double = 2.000014
    Dim result = tree.Nearest(query, radius)

I get the function that uses the int32 as the second parameter so the results are limited to the 2 in that case. It should return 20.

Regarding Dim result = ... I have tried it both:

    Dim result = tree.Nearest(query, radius)
    'and
    Dim result As KDTreeNodeCollection(Of KDTreeNode(Of Integer)) = tree.Nearest(query, radius)

Neither works.

来源:https://stackoverflow.com/questions/52130631/radius-is-not-a-parameter-in-vb-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!