-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
Type param Void #3463
Comments
Array of Void does not make sense in the first place. Maybe we should actually forbid Void in type parameters unless @:generic ? |
I think people like to use it for Signals or something. |
But that's probably only |
As Simn mentioned, I was using it for Signals and promhx, to denote an event without any event data. var intset = new Map<Int, Void>();
intset.set(3, null);
trace(intset.exists(3)); //true Anyway my use case is to have a type that accepts nothing but |
I think we should allow parameters of class Nv
{
static function main()
{
foo(null);
}
static function foo(nv:Null<Void>):Void
{
}
} |
There's something about the |
Another option would be to give some semantics to |
Something like this crashes the JVM generator with an interface I<T> {
public function test():T;
}
class Main implements I<Void> {
static function main() {}
public function test() {}
} I don't think such a thing should be allowed. |
Please, forbid applying Void as type parameter. |
I would like to see some way to gracefully handle Void as a type parameter. If I have a callback handler that takes T->Void, and I want to make a callback with no argument, I would set T to Void->Void, but that confuses the compiler because there's no argument that satisfies |
IMO, the |
The following fails to be compiled, but I would expect one of the lines of
ones
ortwos
is valid.The text was updated successfully, but these errors were encountered: