Skip to content

Commit 09be04c

Browse files
authored
Merge pull request #9309 from dotnet/merges/master-to-release/dev16.7
Merge master to release/dev16.7
2 parents d7ce94d + 13aaaef commit 09be04c

12 files changed

Lines changed: 200 additions & 172 deletions

File tree

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<FSCoreVersionPrefix>$(FSCoreMajorVersion).0</FSCoreVersionPrefix>
1919
<FSCoreVersion>$(FSCoreVersionPrefix).0</FSCoreVersion>
2020
<!-- The current published nuget package -->
21-
<FSharpCoreShippedPackageVersion>4.7.1</FSharpCoreShippedPackageVersion>
21+
<FSharpCoreShippedPackageVersion>4.7.2</FSharpCoreShippedPackageVersion>
2222
<!-- The pattern for specifying the preview package -->
2323
<FSharpCorePreviewPackageVersion>$(FSCorePackageVersion)-$(PreReleaseVersionLabel).*</FSharpCorePreviewPackageVersion>
2424
</PropertyGroup>

src/absil/ilread.fs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,17 @@ let seekReadUInt16AsInt32 mdv addr = int32 (seekReadUInt16 mdv addr)
199199

200200
let seekReadCompressedUInt32 mdv addr =
201201
let b0 = seekReadByte mdv addr
202-
if b0 <= 0x7Fuy then int b0, addr+1
202+
if b0 <= 0x7Fuy then struct (int b0, addr+1)
203203
elif b0 <= 0xBFuy then
204204
let b0 = b0 &&& 0x7Fuy
205205
let b1 = seekReadByteAsInt32 mdv (addr+1)
206-
(int b0 <<< 8) ||| int b1, addr+2
206+
struct ((int b0 <<< 8) ||| int b1, addr+2)
207207
else
208208
let b0 = b0 &&& 0x3Fuy
209209
let b1 = seekReadByteAsInt32 mdv (addr+1)
210210
let b2 = seekReadByteAsInt32 mdv (addr+2)
211211
let b3 = seekReadByteAsInt32 mdv (addr+3)
212-
(int b0 <<< 24) ||| (int b1 <<< 16) ||| (int b2 <<< 8) ||| int b3, addr+4
212+
struct ((int b0 <<< 24) ||| (int b1 <<< 16) ||| (int b2 <<< 8) ||| int b3, addr+4)
213213

214214
let seekReadSByte mdv addr = sbyte (seekReadByte mdv addr)
215215
let seekReadSingle mdv addr = singleOfBits (seekReadInt32 mdv addr)
@@ -226,11 +226,11 @@ let seekReadUTF8String mdv addr =
226226
System.Text.Encoding.UTF8.GetString (bytes, 0, bytes.Length)
227227

228228
let seekReadBlob mdv addr =
229-
let len, addr = seekReadCompressedUInt32 mdv addr
229+
let struct (len, addr) = seekReadCompressedUInt32 mdv addr
230230
seekReadBytes mdv addr len
231231

232232
let seekReadUserString mdv addr =
233-
let len, addr = seekReadCompressedUInt32 mdv addr
233+
let struct (len, addr) = seekReadCompressedUInt32 mdv addr
234234
let bytes = seekReadBytes mdv addr (len - 1)
235235
Encoding.Unicode.GetString(bytes, 0, bytes.Length)
236236

@@ -1550,11 +1550,10 @@ and readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx) =
15501550

15511551
and seekReadTypeDefRowExtents (ctxt: ILMetadataReader) _info (idx: int) =
15521552
if idx >= ctxt.getNumRows TableNames.TypeDef then
1553-
ctxt.getNumRows TableNames.Field + 1,
1554-
ctxt.getNumRows TableNames.Method + 1
1553+
struct (ctxt.getNumRows TableNames.Field + 1, ctxt.getNumRows TableNames.Method + 1)
15551554
else
15561555
let (_, _, _, _, fieldsIdx, methodsIdx) = seekReadTypeDefRow ctxt (idx + 1)
1557-
fieldsIdx, methodsIdx
1556+
struct (fieldsIdx, methodsIdx )
15581557

15591558
and seekReadTypeDefRowWithExtents ctxt (idx: int) =
15601559
let info= seekReadTypeDefRow ctxt idx
@@ -1578,7 +1577,7 @@ and typeDefReader ctxtH: ILTypeDefStored =
15781577

15791578
let ((flags, nameIdx, namespaceIdx, extendsIdx, fieldsIdx, methodsIdx) as info) = seekReadTypeDefRow ctxt idx
15801579
let nm = readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx)
1581-
let (endFieldsIdx, endMethodsIdx) = seekReadTypeDefRowExtents ctxt info idx
1580+
let struct (endFieldsIdx, endMethodsIdx) = seekReadTypeDefRowExtents ctxt info idx
15821581
let typars = seekReadGenericParams ctxt 0 (tomd_TypeDef, idx)
15831582
let numtypars = typars.Length
15841583
let super = seekReadOptionalTypeDefOrRef ctxt numtypars AsObject extendsIdx

src/fsharp/CompileOps.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ let OutputPhasedErrorR (os: StringBuilder) (err: PhasedDiagnostic) (canSuggestNa
821821
let nameOrOneBasedIndexMessage =
822822
x.calledArg.NameOpt
823823
|> Option.map (fun n -> FSComp.SR.csOverloadCandidateNamedArgumentTypeMismatch n.idText)
824-
|> Option.defaultValue (FSComp.SR.csOverloadCandidateIndexedArgumentTypeMismatch ((snd x.calledArg.Position) + 1))
824+
|> Option.defaultValue (FSComp.SR.csOverloadCandidateIndexedArgumentTypeMismatch ((Lib.vsnd x.calledArg.Position) + 1)) //snd
825825
sprintf " // %s" nameOrOneBasedIndexMessage
826826
| _ -> ""
827827

src/fsharp/FSharp.Build/Fsc.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ type public Fsc () as this =
589589

590590
override fsc.GenerateResponseFileCommands() =
591591
let builder = generateCommandLineBuilder ()
592-
builder.GetCapturedArguments() |> Seq.fold(fun acc f -> acc + f + Environment.NewLine) ""
592+
builder.GetCapturedArguments() |> String.concat Environment.NewLine
593593

594594
// expose this to internal components (for nunit testing)
595595
member internal fsc.InternalGenerateCommandLineCommands() =

src/fsharp/FSharp.Build/Fsi.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ type public Fsi () as this =
322322

323323
override fsi.GenerateResponseFileCommands() =
324324
let builder = generateCommandLineBuilder ()
325-
builder.GetCapturedArguments() |> Seq.fold(fun acc f -> acc + f + Environment.NewLine) ""
325+
builder.GetCapturedArguments() |> String.concat Environment.NewLine
326326

327327
// expose this to internal components (for nunit testing)
328328
member internal fsi.InternalGenerateCommandLineCommands() =

src/fsharp/FSharp.Core/prim-types.fs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,7 @@ namespace Microsoft.FSharp.Core
10451045
// gives reliable results on null values.
10461046
System.String.CompareOrdinal((# "" x : string #),(# "" y : string #))
10471047
when 'T : decimal = System.Decimal.Compare((# "" x:decimal #), (# "" y:decimal #))
1048+
when 'T : DateTime = System.DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #))
10481049

10491050

10501051
/// Generic comparison. Implements ER mode (where "0" is returned when NaNs are compared)
@@ -1123,6 +1124,7 @@ namespace Microsoft.FSharp.Core
11231124
// gives reliable results on null values.
11241125
System.String.CompareOrdinal((# "" x : string #),(# "" y : string #))
11251126
when 'T : decimal = System.Decimal.Compare((# "" x:decimal #), (# "" y:decimal #))
1127+
when 'T : DateTime = System.DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #))
11261128

11271129
/// Generic less-than with static optimizations for some well-known cases.
11281130
let inline GenericLessThanFast (x:'T) (y:'T) =
@@ -1142,6 +1144,7 @@ namespace Microsoft.FSharp.Core
11421144
when 'T : float32= (# "clt" x y : bool #)
11431145
when 'T : char = (# "clt" x y : bool #)
11441146
when 'T : decimal = System.Decimal.op_LessThan ((# "" x:decimal #), (# "" y:decimal #))
1147+
when 'T : DateTime = DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #)) < 0
11451148

11461149
/// Generic greater-than with static optimizations for some well-known cases.
11471150
let inline GenericGreaterThanFast (x:'T) (y:'T) =
@@ -1161,6 +1164,7 @@ namespace Microsoft.FSharp.Core
11611164
when 'T : float32 = (# "cgt" x y : bool #)
11621165
when 'T : char = (# "cgt" x y : bool #)
11631166
when 'T : decimal = System.Decimal.op_GreaterThan ((# "" x:decimal #), (# "" y:decimal #))
1167+
when 'T : DateTime = DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #)) > 0
11641168

11651169
/// Generic less-than-or-equal with static optimizations for some well-known cases.
11661170
let inline GenericLessOrEqualFast (x:'T) (y:'T) =
@@ -1180,6 +1184,7 @@ namespace Microsoft.FSharp.Core
11801184
when 'T : float32 = not (# "cgt.un" x y : bool #)
11811185
when 'T : char = not(# "cgt" x y : bool #)
11821186
when 'T : decimal = System.Decimal.op_LessThanOrEqual ((# "" x:decimal #), (# "" y:decimal #))
1187+
when 'T : DateTime = DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #)) <= 0
11831188

11841189
/// Generic greater-than-or-equal with static optimizations for some well-known cases.
11851190
let inline GenericGreaterOrEqualFast (x:'T) (y:'T) =
@@ -1199,6 +1204,8 @@ namespace Microsoft.FSharp.Core
11991204
when 'T : float32 = not (# "clt.un" x y : bool #)
12001205
when 'T : char = not (# "clt" x y : bool #)
12011206
when 'T : decimal = System.Decimal.op_GreaterThanOrEqual ((# "" x:decimal #), (# "" y:decimal #))
1207+
1208+
when 'T : DateTime = DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #)) >= 0
12021209

12031210

12041211
//-------------------------------------------------------------------------
@@ -1482,6 +1489,7 @@ namespace Microsoft.FSharp.Core
14821489
when 'T : char = (# "ceq" x y : bool #)
14831490
when 'T : string = System.String.Equals((# "" x : string #),(# "" y : string #))
14841491
when 'T : decimal = System.Decimal.op_Equality((# "" x:decimal #), (# "" y:decimal #))
1492+
when 'T : DateTime = DateTime.Equals((# "" x : DateTime #), (# "" y : DateTime #))
14851493

14861494
/// Implements generic equality between two values, with PER semantics for NaN (so equality on two NaN values returns false)
14871495
//
@@ -1504,6 +1512,8 @@ namespace Microsoft.FSharp.Core
15041512
when 'T : unativeint = (# "ceq" x y : bool #)
15051513
when 'T : string = System.String.Equals((# "" x : string #),(# "" y : string #))
15061514
when 'T : decimal = System.Decimal.op_Equality((# "" x:decimal #), (# "" y:decimal #))
1515+
when 'T : DateTime = DateTime.Equals((# "" x : DateTime #), (# "" y : DateTime #))
1516+
15071517

15081518
/// A compiler intrinsic generated during optimization of calls to GenericEqualityIntrinsic on tuple values.
15091519
//
@@ -1530,6 +1540,7 @@ namespace Microsoft.FSharp.Core
15301540
when 'T : unativeint = (# "ceq" x y : bool #)
15311541
when 'T : string = System.String.Equals((# "" x : string #),(# "" y : string #))
15321542
when 'T : decimal = System.Decimal.op_Equality((# "" x:decimal #), (# "" y:decimal #))
1543+
when 'T : DateTime = DateTime.Equals((# "" x : DateTime #), (# "" y : DateTime #))
15331544

15341545

15351546
let inline GenericInequalityFast (x:'T) (y:'T) = (not(GenericEqualityFast x y) : bool)

src/fsharp/MethodCalls.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type CallerArg<'T> =
6161

6262
/// Represents the information about an argument in the method being called
6363
type CalledArg =
64-
{ Position: (int * int)
64+
{ Position: struct (int * int)
6565
IsParamArray : bool
6666
OptArgInfo : OptionalArgInfo
6767
CallerInfo : CallerInfo
@@ -303,7 +303,7 @@ let MakeCalledArgs amap m (minfo: MethInfo) minst =
303303
// Mark up the arguments with their position, so we can sort them back into order later
304304
let paramDatas = minfo.GetParamDatas(amap, m, minst)
305305
paramDatas |> List.mapiSquared (fun i j (ParamData(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfoFlags, nmOpt, reflArgInfo, typeOfCalledArg)) ->
306-
{ Position=(i,j)
306+
{ Position=struct(i,j)
307307
IsParamArray=isParamArrayArg
308308
OptArgInfo=optArgInfo
309309
CallerInfo = callerInfoFlags

src/fsharp/lib.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,3 +564,4 @@ type MaybeLazy<'T> =
564564
| Strict x -> x
565565
| Lazy x -> x.Force()
566566

567+
let inline vsnd ((_, y): struct('T * 'T)) = y

src/fsharp/service/ServiceLexing.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,15 +616,15 @@ type FSharpLineTokenizer(lexbuf: UnicodeLexing.Lexbuf,
616616
| Some mx when rightp.Line > leftp.Line -> mx
617617
| _ -> rightp.Column
618618
let rightc = rightc - 1
619-
leftc, rightc
619+
struct (leftc, rightc)
620620

621621
// Get the token & position - either from a stack or from the lexer
622622
try
623623
if (tokenStack.Count > 0) then true, tokenStack.Pop()
624624
else
625625
// Choose which lexer entry point to call and call it
626626
let token = LexerStateEncoding.callLexCont lexcontInitial lexargs skip lexbuf
627-
let leftc, rightc = ColumnsOfCurrentToken()
627+
let struct (leftc, rightc) = ColumnsOfCurrentToken()
628628

629629
// Splits tokens like ">." into multiple tokens - this duplicates behavior from the 'lexfilter'
630630
// which cannot be (easily) used from the language service. The rules here are not always valid,

0 commit comments

Comments
 (0)