Skip to content

Boolean interface in lib.d.ts has no members #1387

@danquirk

Description

@danquirk

We define Boolean like this:

interface Boolean {
}
declare var Boolean: {
    new (value?: any): Boolean;
    (value?: any): boolean;
    prototype: Boolean;
}

Which as you might expect means we allow you to assign anything to a variable of type Boolean. Obviously the uses for Boolean rather than boolean are few (if any) but nonetheless:

var b = new Boolean();
b = 1; // ok
b = "a"; // ok

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions