Skip to content

Type annotation that worked in v11 now gives error Did you mean to annotate the parameter type or the return type? #7862

@mediremi

Description

@mediremi

In v11, the following compiles fine:

let f = (): array<nullable<int>> => {
  []
}

Playground link

but from v12.0.0-alpha.13 onwards it gives this error:

Did you mean to annotate the parameter type or the return type?
  1) (pattern): array<nullable<int>> => {
    []
  }
  2) (pattern: array<nullable<int>>) => {
    []
  }

Alpha 13 playground link
Beta 10 playground link

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