Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Type 'X<false>' is not assignable to type 'X<boolean>'. #48150

Copy link
Copy link
@tomhanax

Description

@tomhanax
Issue body actions

Bug Report

Since 4.6 TS is complaining about that false is not assignable to boolean, when it is "wrapped by interface".

🔎 Search Terms

4.6 type

🕗 Version & Regression Information

  • This is a compile problem
  • This changed between versions 4.5.5 and 4.6

⏯ Playground Link

Playground Link

💻 Code

interface Observable<T>
{
  (): T;
  (value: T): any;
}

function observable<T>(value: T): Observable<T>
{
  return undefined as any;  // the implementation is not important
}

const x: Observable<boolean> = observable(false);

🙁 Actual behavior

Type 'Observable<false>' is not assignable to type 'Observable<boolean>'.
  Types of parameters 'value' and 'value' are incompatible.
    Type 'boolean' is not assignable to type 'false'.

🙂 Expected behavior

No compiler problem as in previous versions.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.