Skip to content

cannot use void as template argument #306

Closed
@kazuho

Description

@kazuho

User-defined template classes should accept void as type arguments, while at least some built-tin classes (e.g. Array.<T> and Map.<T> should not).

The code snippet below fails to compile with the error message: 'void' cannot be used here.

class Foo.<T> {
    static function callIt(f : () -> T) : void {
        f();
    }
}

class _Main {
    static function main(args : string[]) : void {
        Foo.<void>.callIt(function () {});
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions