We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
2 parentscba5226 +c30aab1 commit8f92284Copy full SHA for 8f92284
src/fsharp/NameResolution.fs
@@ -1735,8 +1735,12 @@ let private ResolveObjectConstructorPrim (ncenv:NameResolver) edenv resInfo m ad
1735
success(resInfo, Item.FakeInterfaceCtor typ)
1736
else
1737
letdefaultStructCtorInfo=
1738
-if(isStructTy g typ&¬(isRecdTy g typ)&¬(isUnionTy g typ)&¬(ctorInfos|> List.exists(fun x-> x.IsNullary)))then
1739
-[DefaultStructCtor(g,typ)]
+if(not(ctorInfos|> List.exists(fun x-> x.IsNullary))&&
+ isStructTy g typ&&
1740
+not(isRecdTy g typ)&&
1741
+not(isUnionTy g typ))
1742
+then
1743
+[DefaultStructCtor(g,typ)]
1744
else[]
1745
if(isNil defaultStructCtorInfo&& isNil ctorInfos)||not(isAppTy g typ)then
1746
raze(Error(FSComp.SR.nrNoConstructorsAvailableForType(NicePrint.minimalStringOfType edenv typ),m))