@@ -1578,7 +1578,7 @@ module Array =
1578
1578
checkNonNull " array" array
1579
1579
Microsoft.FSharp.Primitives.Basics.Array.permute indexMap array
1580
1580
1581
- let inline private classicSum ( array : ^T array ) : ^T =
1581
+ let inline private fsharpSumImpl ( array : ^T array ) : ^T =
1582
1582
checkNonNull " array" array
1583
1583
let mutable acc = LanguagePrimitives.GenericZero< ^ T>
1584
1584
@@ -1587,26 +1587,28 @@ module Array =
1587
1587
1588
1588
acc
1589
1589
1590
+ let isNetFramework = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith " .NET Framework"
1591
+
1590
1592
[<CompiledName( " Sum" ) >]
1591
1593
let inline sum ( array : ^T array ) : ^T =
1592
- classicSum array
1594
+ fsharpSumImpl array
1593
1595
when ^ T : float =
1594
- if System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith " .NET Framework " then classicSum array
1596
+ if isNetFramework then fsharpSumImpl array
1595
1597
else
1596
1598
let r = ( System.Linq.Enumerable.Sum : IEnumerable< float> -> float) ( # " " array : IEnumerable< float> #)
1597
1599
( # " " r : 'T #)
1598
1600
when ^ T : float32 =
1599
- if System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith " .NET Framework " then classicSum array
1601
+ if isNetFramework then fsharpSumImpl array
1600
1602
else
1601
1603
let r = ( System.Linq.Enumerable.Sum : IEnumerable< float32> -> float32) ( # " " array : IEnumerable< float32> #)
1602
1604
( # " " r : 'T #)
1603
1605
when ^ T : int =
1604
- if System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith " .NET Framework " then classicSum array
1606
+ if isNetFramework then fsharpSumImpl array
1605
1607
else
1606
1608
let r = ( System.Linq.Enumerable.Sum : IEnumerable< int> -> int) ( # " " array : IEnumerable< int> #)
1607
1609
( # " " r : 'T #)
1608
1610
when ^ T : int64 =
1609
- if System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith " .NET Framework " then classicSum array
1611
+ if isNetFramework then fsharpSumImpl array
1610
1612
else
1611
1613
let r = ( System.Linq.Enumerable.Sum : IEnumerable< int64> -> int64) ( # " " array : IEnumerable< int64> #)
1612
1614
( # " " r : 'T #)
0 commit comments