You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<anon>:17:23: 17:66 error: no method named `some_function` found for type `ApiFromC` in the current scope
<anon>:17 (*self.api_from_c).some_function((*self.api_from_c).some_data)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<anon>:17:23: 17:66 note: did you mean to write `(*self.api_from_c).some_function`?
<anon>:17 (*self.api_from_c).some_function((*self.api_from_c).some_data)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
playpen: application terminated with error code 101
So the correct way to fix this code is by changing
But it's from the error message not very clear that's the issue.
The text was updated successfully, but these errors were encountered:
huonw
added
A-diagnostics
Area: Messages for errors, warnings, and lints
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
and removed
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
labels
Oct 14, 2015
Strangely enough, there is a custom error message to handle this case but it seems that it isn't emitted for fields that are extern fns, e.g. if the extern is removed from api_from_c's type, the output looks like:
<anon>:17:23: 17:66 error: no method named `some_function` found for type `ApiFromC` in the current scope
<anon>:17 (*self.api_from_c).some_function((*self.api_from_c).some_data)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<anon>:17:23: 17:66 note: use `((*self.api_from_c).some_function)(...)` if you meant to call the function stored in the `some_function` field
<anon>:17 (*self.api_from_c).some_function((*self.api_from_c).some_data)
So presumably some match or if somewhere in the compiler needs to understand that extern fns are fns.
Hi,
When compiling this code
Playpen link: http://is.gd/BwFkak
The error message produced
So the correct way to fix this code is by changing
to
But it's from the error message not very clear that's the issue.
The text was updated successfully, but these errors were encountered: