Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Compiler/Checking/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3161,7 +3161,10 @@ module EstablishTypeDefinitionCores =
| None -> ()
| Some spats ->
let ctorArgNames, _ = TcSimplePatsOfUnknownType cenv true CheckCxs envinner tpenv spats
if not ctorArgNames.IsEmpty then errorR (Error(FSComp.SR.parsOnlyClassCanTakeValueArguments(), m))
if not ctorArgNames.IsEmpty then
match spats with
| SynSimplePats.SimplePats(_, m) -> errorR (Error(FSComp.SR.parsOnlyClassCanTakeValueArguments(), m))
| SynSimplePats.Typed(_, _, m) -> errorR (Error(FSComp.SR.parsOnlyClassCanTakeValueArguments(), m))

let envinner = AddDeclaredTypars CheckForDuplicateTypars (tycon.Typars m) envinner
let envinner = MakeInnerEnvForTyconRef envinner thisTyconRef false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ namespace FSharpTest
"""
|> compile
|> shouldFail
|> withErrorCode 552
|> withErrorMessage "Only class types may take value arguments"
|> withDiagnostics [
(Error 552, Line 3, Col 11, Line 3, Col 19, "Only class types may take value arguments")
]

[<Fact>]
let ``Delegate definition with primary constructor no argument.`` () =
Expand All @@ -30,8 +31,10 @@ namespace FSharpTest
"""
|> compile
|> shouldFail
|> withErrorCode 552
|> withErrorMessage "Only class types may take value arguments"
|> shouldFail
|> withDiagnostics [
(Error 552, Line 3, Col 11, Line 3, Col 13, "Only class types may take value arguments")
]

[<Fact>]
let ``Delegate definition`` () =
Expand Down

This file was deleted.

This file was deleted.