Skip to content

internal error when implementing interface with auto property in record type (Unexpected definition (AutoProperty...) #13690

Closed
@smoothdeveloper

Description

@smoothdeveloper

Under .net framework FSI, I'm getting internal error:

Repro steps

type Foo =
  abstract member X : string with get, set

type FooImpl = 
  { name: string }
  interface Foo with
    member val X = "" with get, set

Actual behavior

error FS0073: internal error: Unexpected definition (AutoProperty
   ([], false, X, None, PropertyGetSet, <fun:_fsyacc_reductions@2322-424>,
    PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), None,
    \test.fsx (7,17--7,18),
    Const
      (String
         ("", Regular,
          \test.fsx (7,19--7,21)),
       \test.fsx (7,19--7,21)),
    Some
      \test.fsx (7,22--7,26),
    Some
      \test.fsx (7,22--7,35),
    \test.fsx (7,4--7,21)),
 ContainerInfo
  (Parent FSI_0002,
   Some
     (MemberOrValContainerInfo
        (FooImpl,
         Some
           (Foo,
            SlotImplSet
              ([RequiredSlot (FSMeth (<TcGlobals>, Foo, X, None), false);
                RequiredSlot (FSMeth (<TcGlobals>, Foo, X, None), false)],
               map
                 [("get_X",
                   [RequiredSlot (FSMeth (<TcGlobals>, Foo, X, None), false)]);
                  ("set_X",
                   [RequiredSlot (FSMeth (<TcGlobals>, Foo, X, None), false)])],
               [], [FSProp (<TcGlobals>, Foo, Some X, Some X)])), None,
         NoSafeInitInfo, []))))

Expected behavior

Compiles.

Known workarounds

To not use a record.

Related information

  • Windows 11
  • .NET Framework 4.8 FSI
  • VS 2022 17.2.6

Metadata

Metadata

Assignees

Labels

Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions