Skip to content

Indexer/propery is allowed to have mismatched value type #9232

@auduchinok

Description

@auduchinok

No warnings/errors are produced for the following code:

type T() =
    member x.Item
        with get (index: int): string = ""
        and set (index: int) (value: float) = ()

There's a wrong signature for the setter in fsi:
Screenshot 2020-05-19 at 20 53 46

A tooltip for the property doesn't show the setter at all:
Screenshot 2020-05-19 at 20 53 59

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingBugImpact-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