Disallow abstract member with access modifiers in sig file
Description
Disallow abstract member with access modifiers in signature files.
// in a .fsi file
type A =
abstract internal B: int ->int
abstract member C: int with internal get, private set
Before: All these will build successfully After: Error FS0561: Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type.
Checklist
- [x] Test cases added
:heavy_exclamation_mark: Release notes required
:white_check_mark: Found changes and release notes in following paths:
Change path Release notes path Description src/Compilerdocs/release-notes/.FSharp.Compiler.Service/9.0.200.md
@Tangent-90 - Hey, I was wondering why would an internal abstract member not be allowed on a public type? After all the assembly where it is defined, as well as friend assemblies can still implement it?
@Tangent-90 - Hey, I was wondering why would an internal abstract member not be allowed on a public type? After all the assembly where it is defined, as well as friend assemblies can still implement it?
Hmm... I just simply find out that abstract internal in .fs file is not allowed, and in .fsi file will take no effect.
error when running Plain_Build_MacOS/Regular rebuild of FSharp.Compiler.Service.sln
Unhandled exception. System.BadImageFormatException: Bad IL format. The format of the file '/Users/runner/work/1/s/artifacts/bin/fsyacc/Debug/net9.0/osx-x64/fsyacc.dll' is invalid. /var/folders/t5/14gs56bj7djcylkj26c908n40000gn/T/MSBuildTemprunner/tmpb55944d209f44f83b58b156af720d99b.exec.cmd: line 2: 4313 Abort trap: 6 "/Users/runner/hostedtoolcache/dotnet/dotnet" "/Users/runner/work/1/s/artifacts//bin/fsyacc/Debug/net9.0/osx-x64/fsyacc.dll" -o "/Users/runner/work/1/s/artifacts/obj/FSharp.Compiler.Service/Debug/net9.0/ilpars.fs" --module FSharp.Compiler.AbstractIL.AsciiParser --open FSharp.Compiler.AbstractIL.AsciiConstants --open FSharp.Compiler.AbstractIL.IL --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing --buffer-type-argument char AbstractIL/ilpars.fsy /Users/runner/work/1/s/buildtools/buildtools.targets(54,5): error MSB3073: The command ""/Users/runner/hostedtoolcache/dotnet/dotnet" "/Users/runner/work/1/s/artifacts//bin/fsyacc/Debug/net9.0/osx-x64/fsyacc.dll" -o "/Users/runner/work/1/s/artifacts/obj/FSharp.Compiler.Service/Debug/net9.0/ilpars.fs" --module FSharp.Compiler.AbstractIL.AsciiParser --open FSharp.Compiler.AbstractIL.AsciiConstants --open FSharp.Compiler.AbstractIL.IL --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing --buffer-type-argument char AbstractIL/ilpars.fsy" exited with code 134. [/Users/runner/work/1/s/src/Compiler/FSharp.Compiler.Service.fsproj::TargetFramework=net9.0]
Failed to run : https://github.com/dotnet/fsharp/actions/runs/11104909529
error when running
Plain_Build_MacOS/Regular rebuild of FSharp.Compiler.Service.slnUnhandled exception. System.BadImageFormatException: Bad IL format. The format of the file '/Users/runner/work/1/s/artifacts/bin/fsyacc/Debug/net9.0/osx-x64/fsyacc.dll' is invalid. /var/folders/t5/14gs56bj7djcylkj26c908n40000gn/T/MSBuildTemprunner/tmpb55944d209f44f83b58b156af720d99b.exec.cmd: line 2: 4313 Abort trap: 6 "/Users/runner/hostedtoolcache/dotnet/dotnet" "/Users/runner/work/1/s/artifacts//bin/fsyacc/Debug/net9.0/osx-x64/fsyacc.dll" -o "/Users/runner/work/1/s/artifacts/obj/FSharp.Compiler.Service/Debug/net9.0/ilpars.fs" --module FSharp.Compiler.AbstractIL.AsciiParser --open FSharp.Compiler.AbstractIL.AsciiConstants --open FSharp.Compiler.AbstractIL.IL --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing --buffer-type-argument char AbstractIL/ilpars.fsy /Users/runner/work/1/s/buildtools/buildtools.targets(54,5): error MSB3073: The command ""/Users/runner/hostedtoolcache/dotnet/dotnet" "/Users/runner/work/1/s/artifacts//bin/fsyacc/Debug/net9.0/osx-x64/fsyacc.dll" -o "/Users/runner/work/1/s/artifacts/obj/FSharp.Compiler.Service/Debug/net9.0/ilpars.fs" --module FSharp.Compiler.AbstractIL.AsciiParser --open FSharp.Compiler.AbstractIL.AsciiConstants --open FSharp.Compiler.AbstractIL.IL --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing --buffer-type-argument char AbstractIL/ilpars.fsy" exited with code 134. [/Users/runner/work/1/s/src/Compiler/FSharp.Compiler.Service.fsproj::TargetFramework=net9.0]
Seen this in the past. Had to close and reopen my PR multiple times until the CI is green.
Failed to run : https://github.com/dotnet/fsharp/actions/runs/11243858547
/azp run
Azure Pipelines successfully started running 2 pipeline(s).