fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Disallow abstract member with access modifiers in sig file

Open ijklam opened this issue 1 year ago • 9 comments

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

ijklam avatar Sep 26 '24 18:09 ijklam

:heavy_exclamation_mark: Release notes required


:white_check_mark: Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/9.0.200.md

github-actions[bot] avatar Sep 26 '24 18:09 github-actions[bot]

@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?

KevinRansom avatar Sep 26 '24 19:09 KevinRansom

@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.

ijklam avatar Sep 27 '24 00:09 ijklam

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]

ijklam avatar Sep 30 '24 11:09 ijklam

Failed to run : https://github.com/dotnet/fsharp/actions/runs/11104909529

github-actions[bot] avatar Sep 30 '24 11:09 github-actions[bot]

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]

Seen this in the past. Had to close and reopen my PR multiple times until the CI is green.

edgarfgp avatar Oct 08 '24 21:10 edgarfgp

Failed to run : https://github.com/dotnet/fsharp/actions/runs/11243858547

github-actions[bot] avatar Oct 08 '24 21:10 github-actions[bot]

/azp run

psfinaki avatar Oct 14 '24 15:10 psfinaki

Azure Pipelines successfully started running 2 pipeline(s).

azure-pipelines[bot] avatar Oct 14 '24 15:10 azure-pipelines[bot]