Skip to content

Improve error reporting: Missing = on type declaration #1121

Description

@isaacabraham

What

The following error message is generated from this code sample

type Person { Name : string; Age : int; City : string }

error FS0010: Unexpected symbol '{' in type definition. Expected '(' or other token.

Why

The error message suggests to the user that they should put a ( in to fix the problem (or some other unspecified token), when in fact they have missed the = operator. Many other languages allow you to define types without the = sign, so this is not an uncommon issue.

How

Rewrite the above error to something like error FS0010: Unexpected symbol '{' in type definition. Did you forget to use the = operator e.g. "type Person = { Name ..." .

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions