@@ -1832,26 +1832,24 @@ and SolveTypRequiresDefaultConstructor (csenv:ConstraintSolverEnv) ndeep m2 trac
18321832| None->
18331833if isStructTy g ty&& TypeHasDefaultValue g m tythen
18341834 CompleteD
1835- elif
1836- GetIntrinsicConstructorInfosOfType csenv.InfoReader m ty
1837- |> List.exists( fun x -> IsMethInfoAccessible amap m AccessibleFromEverywhere x&& x.IsNullary)
1838- then
1839- match tryDestAppTy g tywith
1840- | Some tcrefwhen HasFSharpAttribute g g.attrib_ AbstractClassAttribute tcref.Attribs->
1841- ErrorD( ConstraintSolverError( FSComp.SR.csGenericConstructRequiresNonAbstract( NicePrint.minimalStringOfType denv typ), m, m2))
1842- | _ ->
1843- CompleteD
1844- elif isAppTy g ty&&
1845- (
1846- let tcref = tcrefOfAppTy g ty
1847- tcref.PreEstablishedHasDefaultConstructor||
1848- // F# 3.1 feature: records with CLIMutable attribute should satisfy 'default constructor' constraint
1849- ( tcref.IsRecordTycon&& HasFSharpAttribute g g.attrib_ CLIMutableAttribute tcref.Attribs)
1850- )
1851- then
1852- CompleteD
1853- else
1854- ErrorD( ConstraintSolverError( FSComp.SR.csGenericConstructRequiresPublicDefaultConstructor( NicePrint.minimalStringOfType denv typ), m, m2))
1835+ else
1836+ if GetIntrinsicConstructorInfosOfType csenv.InfoReader m ty
1837+ |> List.exists( fun x -> IsMethInfoAccessible amap m AccessibleFromEverywhere x&& x.IsNullary)
1838+ then
1839+ match tryDestAppTy g tywith
1840+ | Some tcrefwhen HasFSharpAttribute g g.attrib_ AbstractClassAttribute tcref.Attribs->
1841+ ErrorD( ConstraintSolverError( FSComp.SR.csGenericConstructRequiresNonAbstract( NicePrint.minimalStringOfType denv typ), m, m2))
1842+ | _ ->
1843+ CompleteD
1844+ else
1845+ match tryDestAppTy g tywith
1846+ | Some tcrefwhen
1847+ tcref.PreEstablishedHasDefaultConstructor||
1848+ // F# 3.1 feature: records with CLIMutable attribute should satisfy 'default constructor' constraint
1849+ ( tcref.IsRecordTycon&& HasFSharpAttribute g g.attrib_ CLIMutableAttribute tcref.Attribs) ->
1850+ CompleteD
1851+ | _ ->
1852+ ErrorD( ConstraintSolverError( FSComp.SR.csGenericConstructRequiresPublicDefaultConstructor( NicePrint.minimalStringOfType denv typ), m, m2))
18551853
18561854// Parameterized compatibility relation between member signatures. The real work
18571855// is done by "equateTypes" and "subsumeTypes" and "subsumeArg"