Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarfgp committed Aug 13, 2024
1 parent 4a26619 commit cb9b78e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Compiler/Checking/Expressions/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7251,6 +7251,7 @@ and TcObjectExpr (cenv: cenv) env tpenv (objTy, realObjTy, argopt, binds, extraI
assert (typeEquiv g objTy objtyR)
let extraImpls = allTypeImpls.Tail
let supportsObjectExpressionWithoutOverrides = g.langVersion.SupportsFeature(LanguageFeature.AllowObjectExpressionWithoutOverrides)
let isOverallTyAbstract = isOverallTyAbstract || isAbstractTycon tcref.Deref

if not supportsObjectExpressionWithoutOverrides && not isInterfaceTy && (isOverallTyAbstract && overrides'.IsEmpty) && extraImpls.IsEmpty then
errorR (Error(FSComp.SR.tcInvalidObjectExpressionSyntaxForm (), mWholeExpr))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ let res = { new Animal() }
|> compile
|> shouldFail
|> withDiagnostics [
// FIXME
(Error 738, Line 5, Col 11, Line 5, Col 27, "Invalid object expression. Objects without overrides or interfaces should use the expression form 'new Type(args)' without braces.")
]

[<Fact>]
Expand Down Expand Up @@ -568,8 +568,8 @@ let res = { new Animal() }
|> compile
|> shouldFail
|> withDiagnostics [
// Error missing
(Error 365, Line 5, Col 11, Line 5, Col 27, "No implementation was given for 'Animal.M() : unit'")
(Error 365, Line 5, Col 11, Line 5, Col 27, "No implementation was given for 'Animal.M() : unit'");
(Error 738, Line 5, Col 11, Line 5, Col 27, "Invalid object expression. Objects without overrides or interfaces should use the expression form 'new Type(args)' without braces.")
]

[<Fact>]
Expand Down

0 comments on commit cb9b78e

Please sign in to comment.