Skip to content

0.63.x regression: setTimeout() & setInterval() return types broken #5627

@jaredh159

Description

@jaredh159

Error does not exist in 0.62.0

https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVBjOA7AzgFzCjjgC4xsBXAWwCMBTAJzAF4xd78AVAS2vriV8ACmEBKVgD4wAbwC+AGjABmAAyqxAbkw4CYWgENG5KnSat2nAJLZ8TAG4GYoiS2nylajZqA

// @flow
const foo: number = setTimeout(() => {}, 300);
const bar: number = setInterval(() => {}, 300);
3: const foo: number = setTimeout(() => {}, 300);
                       ^ TimeoutID. This type is incompatible with
3: const foo: number = setTimeout(() => {}, 300);
              ^ number
4: const bar: number = setInterval(() => {}, 300);
                       ^ IntervalID. This type is incompatible with
4: const bar: number = setInterval(() => {}, 300);
              ^ number

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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