-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Feature request: Allow type
to return void
#7397
Comments
Also this would allow to distinguish between those two cases: Void type let a = @[1, 2, 3]
let b = @[true, true, false]
type((
block:
var x: type(items(a))
var y: type(items(b))
)) Statement with no type let a = @[1, 2, 3]
let b = @[true, true, false]
type((
block:
var x: type(items(a))
var y: type(items(b))
if y:
x
)) |
I agree, that this is a good idea. |
When I looked at |
You want to force every function to return a value? |
It could be a type like any other. Scala, for instance, has a type |
It can be called, void, Empty or NoneType but fundamentally I don't see how removing it works for a typical program or testing the absence of return values. |
See nim-lang/RFCs#508 for details. |
This is now implemented (since 1.6), #17807 |
Currently you can alias the
void
type but thetype
proc cannot return void, it's a compile-time error.There might be a good reason for it in that case it should be mentionned in the docs, otherwise I think it is a useful feature, here is a related post by @cooldome on the forum.
The text was updated successfully, but these errors were encountered: