Skip to content

Disallow expressions with void type for some operations #2473

@MaxGraey

Description

@MaxGraey
((): void => {})() ? 1 : 0 // TS1345: An expression of type 'void' cannot be tested for truthiness.
if (((): void => {})()) {} // TS1345: An expression of type 'void' cannot be tested for truthiness.
store<void>(1, ((): void => {})());

also

load<void>(1);
load<externref>(1);
load<anyref>(1);
// etc

Segregated from #2208 comments

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