Skip to content

Non-public properties in generated assembly break code completion #1111

Open

Description

@janno-p

I have type provider (generated types) which produces C# assembly. Generated assembly contains class IsikuStaatus with property BaseValue that has public getter and private setter. When accessing that class via Intellisense I get <Note> property with error message containing "Property 'BaseValue' on provided type 'IsikuStaatus' has CanWrite=true but there was no value from GetSetMethod()"

According to MSDN it seems that CanWrite returns false only when setter is not defined, while GetSetMethod() returns only public setter method.

Repro steps

  1. Use type provider which generates properties with non-public setters.
  2. Use Intellisense to navigate to some value of type containing that property.

Expected behavior

Should display read-only property in completion list.

Actual behavior

Displays <Note> property in completion list with message "Property '%s' on provided type '%s' has CanWrite=true but there was no value from GetSetMethod()"

Known workarounds

Ignore <Note> property message and use expected property as normal (won't display any error in editor or throw exception at runtime).

Related information

  • Windows 8.1 Enterprise
  • FSharp.Core v4.0_4.4.0.0
  • .NET Runtime 4.6.1
  • Visual Studio 2015, Tsunami

Activity

  1. added
    Impact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.
    on Jul 18, 2016
  2. added this to the Unknown milestone on Aug 25, 2018
  3. github-actions commented on Sep 26, 2026

    @github-actions
    Contributor

    🤖 This is an automated response from Repo Assist.

    This still reproduces on current main at 4831b381ee941f8bb03a19332c671ac86b9e82c3 (committed 2026-09-25T14:47:51+02:00, 13 hours old when tested).

    I built the compiler from that revision and ran an FCS GetDeclarationListInfo test using a generative type provider whose generated int PrivateSetter property has a public getter and private setter. Completion was requested after:

    type T = GeneratedWithConstructor.Provided.GenerativeProvider<1>
    let value = T()
    value.

    The FCS trace reports:

    FCS: recovering from error in GetDeclarations: Property PrivateSetter on provided type T has CanWrite=true but there was no value from GetSetMethod()
    

    The completion list contained only <Note> and omitted PrivateSetter, matching the original report. The relevant current implementation still calls parameterless PropertyInfo.GetSetMethod(), which excludes a non-public setter even though CanWrite is true.

    Fresh compiler proof:

    Microsoft (R) F# Interactive version 15.2.200.0 for F# 11.2
    Language Version: 11.2
    FSharp.Core: 11.0.0.0
    .NET: .NET 11.0.0-rc.1.26420.103
    OS: Linux 6.17.0-1022-azure (X64)
    

    Warning

    Firewall blocked 1 domain

    The following domain was blocked by the firewall during workflow execution:

    • southcentralus0.in.applicationinsights.azure.com

    To allow these domains, add them to the network.allowed list in your workflow frontmatter:

    network:
      allowed:
        - defaults
        - "southcentralus0.in.applicationinsights.azure.com"

    See Network Configuration for more information.

    Generated by 🌈 Repo Assist, see workflow run. Learn more.

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@7c7feb61a52b662eb2089aa2945588b7a200d404
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-LangService-AutoCompleteautocomplete/intellisenseBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions