Skip to content

Separator between member and type annotation interpreted as operator #4607

@cartermp

Description

@cartermp

Given the following:

type IFoo<'T> =
    abstract member Bar<'T>: name: string -> unit

Expected:

Compiles.

Actual:

Compiler error.

This construct is deprecated: ':' is not permitted as a character in operator names and is reserved for future use

Workaround:

Put a space after the >:

type IFoo<'T> =
    abstract member Bar<'T> : name: string -> unit

Thanks to @jaredpar for pointing this out

Info

Latest F# compiler in VS Preview

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Compiler-Syntaxlexfilter, indentation and parsingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions