Skip to content

Multiple accessibilities given for property getter or setter is not raised for property #15423

@nojaf

Description

@nojaf

Get and set properties cannot have different visibility for the getter and setter

Repro steps

Example:

type Foo() =
    member f.X with internal get (key1, key2) = true and private set (key1, key2) value = ()
    member internal f.Y with get (key1, key2) = true and private set (key1, key2) value = ()

Expected behavior

Both X and Y show the same diagnostic (FS0558)

Actual behavior

f.X won't produce any diagnostics and will create an internal getter and setter.

image

While f.Y will produce

image

Known workarounds

/

Related information

Local compiler

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions