Skip to content

Unable to implement abstract class #3540

Description

@saul
namespaceMicrosoft.VisualStudio.FSharp.Editor.Tests.RoslynopenMicrosoft.CodeAnalysis.OptionsopenSystem.Collections.ImmutabletypeTestOptionSet(?values: ImmutableDictionary<OptionKey, obj>)=inherit OptionSet()letvalues= values |> Option.defaultValue ImmutableDictionary.Empty
override__.GetOption(optionKey:OptionKey)=
values.[optionKey]override__.WithChangedOption(optionAndLanguage:OptionKey,value:obj)=upcast TestOptionSet(values.SetItem(optionAndLanguage, value))// The member that I cannot override (FS0855)override__.GetChangedOptions(optionSet:OptionSet):seq<OptionKey>=
values
|> Seq.filter (fun(KeyValue(k,v))->
optionSet.GetOption(k)<> v
)|> Seq.map (fun(KeyValue(k,_))-> k)

I get the error message:

FS0855	No abstract or interface member was found that corresponds to this override

If I remove the override keyword from the GetChangedOptions member, I then get the following error:

FS0365	No implementation was given for 'OptionSet.GetChangedOptions(optionSet: OptionSet) : System.Collections.Generic.IEnumerable<OptionKey>'

I believe this may have something to do with the fact that GetChangedOptions is internal, but I can't specify that with the override keyword, otherwise I get:

FS0941	Accessibility modifiers are not permitted on overrides or interface implementations

This is currently blocking me completing #3313

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions