Skip to content

Commit 878d4eb

Browse files
authored
Merge pull request #9310 from dotnet/merges/master-to-feature/witness-passing
Merge master to feature/witness-passing
2 parents e0e9426 + 13aaaef commit 878d4eb

File tree

12 files changed

+203
-175
lines changed

12 files changed

+203
-175
lines changed

eng/Versions.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
<PreReleaseVersionLabel>beta</PreReleaseVersionLabel>
1515
<FSLanguageVersion>4.7</FSLanguageVersion>
1616
<FSCoreMajorVersion>$(FSLanguageVersion)</FSCoreMajorVersion>
17-
<FSCorePackageVersion>$(FSCoreMajorVersion).2</FSCorePackageVersion>
17+
<FSCorePackageVersion>$(FSCoreMajorVersion).3</FSCorePackageVersion>
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>
2525
<PropertyGroup>
26-
<FSPackageMajorVersion>10.9</FSPackageMajorVersion>
27-
<FSPackageVersion>$(FSPackageMajorVersion).1</FSPackageVersion>
26+
<FSPackageMajorVersion>10.10</FSPackageMajorVersion>
27+
<FSPackageVersion>$(FSPackageMajorVersion).0</FSPackageVersion>
2828
<FSProductVersionPrefix>$(FSPackageVersion)</FSProductVersionPrefix>
2929
<FSProductVersion>$(FSPackageVersion).0</FSProductVersion>
3030
</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
@@ -1051,6 +1051,7 @@ namespace Microsoft.FSharp.Core
10511051
// gives reliable results on null values.
10521052
System.String.CompareOrdinal((# "" x : string #),(# "" y : string #))
10531053
when 'T : decimal = System.Decimal.Compare((# "" x:decimal #), (# "" y:decimal #))
1054+
when 'T : DateTime = System.DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #))
10541055

10551056

10561057
/// Generic comparison. Implements ER mode (where "0" is returned when NaNs are compared)
@@ -1129,6 +1130,7 @@ namespace Microsoft.FSharp.Core
11291130
// gives reliable results on null values.
11301131
System.String.CompareOrdinal((# "" x : string #),(# "" y : string #))
11311132
when 'T : decimal = System.Decimal.Compare((# "" x:decimal #), (# "" y:decimal #))
1133+
when 'T : DateTime = System.DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #))
11321134

11331135
/// Generic less-than with static optimizations for some well-known cases.
11341136
let inline GenericLessThanFast (x:'T) (y:'T) =
@@ -1148,6 +1150,7 @@ namespace Microsoft.FSharp.Core
11481150
when 'T : float32= (# "clt" x y : bool #)
11491151
when 'T : char = (# "clt" x y : bool #)
11501152
when 'T : decimal = System.Decimal.op_LessThan ((# "" x:decimal #), (# "" y:decimal #))
1153+
when 'T : DateTime = DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #)) < 0
11511154

11521155
/// Generic greater-than with static optimizations for some well-known cases.
11531156
let inline GenericGreaterThanFast (x:'T) (y:'T) =
@@ -1167,6 +1170,7 @@ namespace Microsoft.FSharp.Core
11671170
when 'T : float32 = (# "cgt" x y : bool #)
11681171
when 'T : char = (# "cgt" x y : bool #)
11691172
when 'T : decimal = System.Decimal.op_GreaterThan ((# "" x:decimal #), (# "" y:decimal #))
1173+
when 'T : DateTime = DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #)) > 0
11701174

11711175
/// Generic less-than-or-equal with static optimizations for some well-known cases.
11721176
let inline GenericLessOrEqualFast (x:'T) (y:'T) =
@@ -1186,6 +1190,7 @@ namespace Microsoft.FSharp.Core
11861190
when 'T : float32 = not (# "cgt.un" x y : bool #)
11871191
when 'T : char = not(# "cgt" x y : bool #)
11881192
when 'T : decimal = System.Decimal.op_LessThanOrEqual ((# "" x:decimal #), (# "" y:decimal #))
1193+
when 'T : DateTime = DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #)) <= 0
11891194

11901195
/// Generic greater-than-or-equal with static optimizations for some well-known cases.
11911196
let inline GenericGreaterOrEqualFast (x:'T) (y:'T) =
@@ -1205,6 +1210,8 @@ namespace Microsoft.FSharp.Core
12051210
when 'T : float32 = not (# "clt.un" x y : bool #)
12061211
when 'T : char = not (# "clt" x y : bool #)
12071212
when 'T : decimal = System.Decimal.op_GreaterThanOrEqual ((# "" x:decimal #), (# "" y:decimal #))
1213+
1214+
when 'T : DateTime = DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #)) >= 0
12081215

12091216

12101217
//-------------------------------------------------------------------------
@@ -1488,6 +1495,7 @@ namespace Microsoft.FSharp.Core
14881495
when 'T : char = (# "ceq" x y : bool #)
14891496
when 'T : string = System.String.Equals((# "" x : string #),(# "" y : string #))
14901497
when 'T : decimal = System.Decimal.op_Equality((# "" x:decimal #), (# "" y:decimal #))
1498+
when 'T : DateTime = DateTime.Equals((# "" x : DateTime #), (# "" y : DateTime #))
14911499

14921500
/// Implements generic equality between two values, with PER semantics for NaN (so equality on two NaN values returns false)
14931501
//
@@ -1510,6 +1518,8 @@ namespace Microsoft.FSharp.Core
15101518
when 'T : unativeint = (# "ceq" x y : bool #)
15111519
when 'T : string = System.String.Equals((# "" x : string #),(# "" y : string #))
15121520
when 'T : decimal = System.Decimal.op_Equality((# "" x:decimal #), (# "" y:decimal #))
1521+
when 'T : DateTime = DateTime.Equals((# "" x : DateTime #), (# "" y : DateTime #))
1522+
15131523

15141524
/// A compiler intrinsic generated during optimization of calls to GenericEqualityIntrinsic on tuple values.
15151525
//
@@ -1536,6 +1546,7 @@ namespace Microsoft.FSharp.Core
15361546
when 'T : unativeint = (# "ceq" x y : bool #)
15371547
when 'T : string = System.String.Equals((# "" x : string #),(# "" y : string #))
15381548
when 'T : decimal = System.Decimal.op_Equality((# "" x:decimal #), (# "" y:decimal #))
1549+
when 'T : DateTime = DateTime.Equals((# "" x : DateTime #), (# "" y : DateTime #))
15391550

15401551

15411552
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)