Skip to content

Commit

Permalink
Don't raise no constructor exception
Browse files Browse the repository at this point in the history
  • Loading branch information
auduchinok committed Feb 20, 2023
1 parent d4b4e3b commit 029723f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Compiler/Checking/NameResolution.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2484,10 +2484,10 @@ let private ResolveObjectConstructorPrim (ncenv: NameResolver) edenv resInfo m a
else []
if (isNil defaultStructCtorInfo && isNil ctorInfos) || (not (isAppTy g ty) && not (isAnyTupleTy g ty)) then
let nm = NicePrint.minimalStringOfType edenv ty
if not (isRecdTy g ty || isUnionTy g ty) then
errorR (Error(FSComp.SR.nrNoConstructorsAvailableForType(nm), m))

success (resInfo, Item.Types(nm, [ty]))
if isRecdTy g ty || isUnionTy g ty then
success (resInfo, Item.Types(nm, [ty]))
else
raze (Error(FSComp.SR.nrNoConstructorsAvailableForType(nm), m))
else
let ctorInfos = ctorInfos |> List.filter (IsMethInfoAccessible amap m ad)
let metadataTy = convertToTypeWithMetadataIfPossible g ty
Expand Down

0 comments on commit 029723f

Please sign in to comment.