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
I'm brand new to Nim, and while using the "discard" keyword, I made some code changes where the procedure I called was no longer returning anything. This lead to the "has no type (or is ambiguous)" compiler error, which I now understand to mean "this procedure doesn't return anything, are you trying to discard its value, or assign the result to a variable? Consider dropping any use of the return value of this procedure."
Description
Maybe add some wording in to make it clear how to fix this fairly confusing error, which I took a whack at. If there are more situations where this crops up than just this one, it might be worth it to split this into a separate error?
Alternatives
Not making any changes to existing error messages.
Like I said, I'm brand new to Nim and don't know the full scope under which this error message appears! But if it really only ever means "don't try to use the return value," that may be more helpful. Thanks for being open to feedback!
Also new and also just ran into this error and spent too long trying to figure out that the return function no longer returned anything since I made some modifications. I kept thinking the compiler was bugging out and couldn't find the proc for some reason. Since the phrasing "Has no type (or is ambiguous)" could mean the proc call itself, as in the proc is ambiguous and could not be found. Would be good to have a clearer error to distinguish say that the signature does not match or there is no return value that matches what is available, or something even clearer.
Summary
I'm brand new to Nim, and while using the "discard" keyword, I made some code changes where the procedure I called was no longer returning anything. This lead to the "has no type (or is ambiguous)" compiler error, which I now understand to mean "this procedure doesn't return anything, are you trying to discard its value, or assign the result to a variable? Consider dropping any use of the return value of this procedure."
Description
Maybe add some wording in to make it clear how to fix this fairly confusing error, which I took a whack at. If there are more situations where this crops up than just this one, it might be worth it to split this into a separate error?
Alternatives
Not making any changes to existing error messages.
Additional Information
Here's where I personally ran into this issue: euantorano/serial.nim#46 (comment)
The text was updated successfully, but these errors were encountered: