Skip to content

Fix Internal error when analysing incomplete inherit member #17905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Oct 24, 2024
Merged
2 changes: 2 additions & 0 deletions docs/release-notes/.FSharp.Compiler.Service/9.0.200.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Ensure `frameworkTcImportsCache` mutations are thread-safe. ([PR #17795](https://github.com/dotnet/fsharp/pull/17795))
* Fix concurrency issue in `ILPreTypeDefImpl` ([PR #17812](https://github.com/dotnet/fsharp/pull/17812))
* Fix nullness inference for member val and other OO scenarios ([PR #17845](https://github.com/dotnet/fsharp/pull/17845))
* Fix internal error when analyzing incomplete inherit member ([PR #17905](https://github.com/dotnet/fsharp/pull/17905))


### Added
* Deprecate places where `seq` can be omitted. ([Language suggestion #1033](https://github.com/fsharp/fslang-suggestions/issues/1033), [PR #17772](https://github.com/dotnet/fsharp/pull/17772))
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/SyntaxTree/SyntaxTree.fs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type SynLongIdent =

member this.Range =
match this with
| SynLongIdent([], _, _) -> failwith "rangeOfLidwd"
| SynLongIdent([], _, _) -> Range.Zero
| SynLongIdent([ id ], [], _) -> id.idRange
| SynLongIdent([ id ], [ m ], _) -> unionRanges id.idRange m
| SynLongIdent(h :: t, [], _) -> unionRanges h.idRange (List.last t).idRange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,18 @@ type Class() =
(Error 961, Line 5, Col 5, Line 5, Col 12, "This 'inherit' declaration specifies the inherited type but no arguments. Consider supplying arguments, e.g. 'inherit BaseType(args)'.")
(Error 946, Line 5, Col 13, Line 5, Col 15, "Cannot inherit from interface type. Use interface ... with instead.")
]

[<Fact>]
let ``This 'inherit' declaration specifies the inherited type but no arguments. Type name cannot be empty.`` () =
Fsx """
type Class() =
inherit
"""
|> typecheck
|> shouldFail
|> withDiagnostics [
(Error 3159, Line 3, Col 5, Line 3, Col 12, "Type name cannot be empty.")
]

[<Fact>]
let ``The types System.ValueType, System.Enum, System.Delegate, System.MulticastDelegate and System.Array cannot be used as super types in an object expression or class.`` () =
Expand Down
Loading