Repository navigation
Support 'protected abstract' #12281
Description
Activity
That use of
withis unusual. Could you try this?type SyntaxHighlightingRendererWrapper() = inherit CodeBlockRenderer() let highlightingRenderer = HighlightedCodeBlockRenderer() override _.Write(renderer: HtmlRenderer, codeBlock: CodeBlock): unit = highlightingRenderer.Write(renderer, codeBlock)
I think the issue is related to
protected- Could you link the exact definitions of the virtualWritemethod please?Sure, tried with the syntax without
with, the problem unfortunately persists.Overload resolution
Did some additional investigation.
With the
Writeinlined, the overload taken isoverride HighlightedCodeBlockRenderer.Write : renderer:HtmlRenderer * cb:CodeBlock -> unit
With the
Writein a separaterenderfunction, the overload is:MarkdownObjectRenderer.Write(renderer: RendererBase, obj: MarkdownObject) : unit
Seems like the overload resolution somehow changes depending on the context?
Method in inheritance hierarchy
Here are the exact definitions of the
Writemethod in the inheritance hierarchy:override __.Write(renderer : HtmlRenderer, cb : CodeBlock)
inherits from
CodeBlockRendererprotected override void Write(HtmlRenderer renderer, CodeBlock obj)
inherits from
HtmlObjectRenderer<CodeBlock>
inherits fromMarkdownObjectRenderer<HtmlRenderer, TObject> where TObject : MarkdownObjectpublic virtual void Write(RendererBase renderer, MarkdownObject obj); protected abstract void Write(TRenderer renderer, TObject obj);
- addedImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.Impact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.and removedImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.
on Mar 3, 2022 - changed the title
[-]Compilation Error - Inaccessible method[/-][+]Support 'protected abstract'[/+]on Apr 5, 2022 - addedArea-Compiler-ImportAndInteropimport of .NET DLLs and interopimport of .NET DLLs and interopand removed
on Apr 5, 2022 🤖 This is an automated response from Repo Assist.
I reproduced this on current
mainatfc10369a668762034e27b82451f469321d878009(commit timestamp 2026-10-08 15:17:21 UTC, about 10 hours old at test time). The repository-built FSI reports: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.103Using
MarkdigExtensions.SyntaxHighlighting1.0.3 and the issue reproduction unchanged, I compiled with the repository-builtartifacts/bin/fsc/Proto/net11.0/linux-x64/fsc.dll. It still fails athighlightingRenderer.Write(renderer, codeBlock):Program.fs(12,30): error FS0629: Method 'Write' is not accessible from this code locationThe extracted-function workaround still distinguishes the scenario described here, so the original protected-overload accessibility issue remains reproducible on the latest compiler.
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.allowedlist 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
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNew
Repro steps
ZIP archive of the reproduction:
Repro_fsharp_accessibility.zip
Expected behavior
No compilation errors
Actual behavior
Error
Known workarounds
Extract Write method into a function:
Related information
I can only guess that this has something to do with overload resolution.
Type
HighlightedCodeBlockRendererinherits fromMarkdownObjectRendererthat has a similar protected method: