Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master to feature/witness-passing #9310

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
<PreReleaseVersionLabel>beta</PreReleaseVersionLabel>
<FSLanguageVersion>4.7</FSLanguageVersion>
<FSCoreMajorVersion>$(FSLanguageVersion)</FSCoreMajorVersion>
<FSCorePackageVersion>$(FSCoreMajorVersion).2</FSCorePackageVersion>
<FSCorePackageVersion>$(FSCoreMajorVersion).3</FSCorePackageVersion>
<FSCoreVersionPrefix>$(FSCoreMajorVersion).0</FSCoreVersionPrefix>
<FSCoreVersion>$(FSCoreVersionPrefix).0</FSCoreVersion>
<!-- The current published nuget package -->
<FSharpCoreShippedPackageVersion>4.7.1</FSharpCoreShippedPackageVersion>
<FSharpCoreShippedPackageVersion>4.7.2</FSharpCoreShippedPackageVersion>
<!-- The pattern for specifying the preview package -->
<FSharpCorePreviewPackageVersion>$(FSCorePackageVersion)-$(PreReleaseVersionLabel).*</FSharpCorePreviewPackageVersion>
</PropertyGroup>
<PropertyGroup>
<FSPackageMajorVersion>10.9</FSPackageMajorVersion>
<FSPackageVersion>$(FSPackageMajorVersion).1</FSPackageVersion>
<FSPackageMajorVersion>10.10</FSPackageMajorVersion>
<FSPackageVersion>$(FSPackageMajorVersion).0</FSPackageVersion>
<FSProductVersionPrefix>$(FSPackageVersion)</FSProductVersionPrefix>
<FSProductVersion>$(FSPackageVersion).0</FSProductVersion>
</PropertyGroup>
Expand Down
17 changes: 8 additions & 9 deletions src/absil/ilread.fs
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,17 @@ let seekReadUInt16AsInt32 mdv addr = int32 (seekReadUInt16 mdv addr)

let seekReadCompressedUInt32 mdv addr =
let b0 = seekReadByte mdv addr
if b0 <= 0x7Fuy then int b0, addr+1
if b0 <= 0x7Fuy then struct (int b0, addr+1)
elif b0 <= 0xBFuy then
let b0 = b0 &&& 0x7Fuy
let b1 = seekReadByteAsInt32 mdv (addr+1)
(int b0 <<< 8) ||| int b1, addr+2
struct ((int b0 <<< 8) ||| int b1, addr+2)
else
let b0 = b0 &&& 0x3Fuy
let b1 = seekReadByteAsInt32 mdv (addr+1)
let b2 = seekReadByteAsInt32 mdv (addr+2)
let b3 = seekReadByteAsInt32 mdv (addr+3)
(int b0 <<< 24) ||| (int b1 <<< 16) ||| (int b2 <<< 8) ||| int b3, addr+4
struct ((int b0 <<< 24) ||| (int b1 <<< 16) ||| (int b2 <<< 8) ||| int b3, addr+4)

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

let seekReadBlob mdv addr =
let len, addr = seekReadCompressedUInt32 mdv addr
let struct (len, addr) = seekReadCompressedUInt32 mdv addr
seekReadBytes mdv addr len

let seekReadUserString mdv addr =
let len, addr = seekReadCompressedUInt32 mdv addr
let struct (len, addr) = seekReadCompressedUInt32 mdv addr
let bytes = seekReadBytes mdv addr (len - 1)
Encoding.Unicode.GetString(bytes, 0, bytes.Length)

Expand Down Expand Up @@ -1550,11 +1550,10 @@ and readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx) =

and seekReadTypeDefRowExtents (ctxt: ILMetadataReader) _info (idx: int) =
if idx >= ctxt.getNumRows TableNames.TypeDef then
ctxt.getNumRows TableNames.Field + 1,
ctxt.getNumRows TableNames.Method + 1
struct (ctxt.getNumRows TableNames.Field + 1, ctxt.getNumRows TableNames.Method + 1)
else
let (_, _, _, _, fieldsIdx, methodsIdx) = seekReadTypeDefRow ctxt (idx + 1)
fieldsIdx, methodsIdx
struct (fieldsIdx, methodsIdx )

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

let ((flags, nameIdx, namespaceIdx, extendsIdx, fieldsIdx, methodsIdx) as info) = seekReadTypeDefRow ctxt idx
let nm = readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx)
let (endFieldsIdx, endMethodsIdx) = seekReadTypeDefRowExtents ctxt info idx
let struct (endFieldsIdx, endMethodsIdx) = seekReadTypeDefRowExtents ctxt info idx
let typars = seekReadGenericParams ctxt 0 (tomd_TypeDef, idx)
let numtypars = typars.Length
let super = seekReadOptionalTypeDefOrRef ctxt numtypars AsObject extendsIdx
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/CompileOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ let OutputPhasedErrorR (os: StringBuilder) (err: PhasedDiagnostic) (canSuggestNa
let nameOrOneBasedIndexMessage =
x.calledArg.NameOpt
|> Option.map (fun n -> FSComp.SR.csOverloadCandidateNamedArgumentTypeMismatch n.idText)
|> Option.defaultValue (FSComp.SR.csOverloadCandidateIndexedArgumentTypeMismatch ((snd x.calledArg.Position) + 1))
|> Option.defaultValue (FSComp.SR.csOverloadCandidateIndexedArgumentTypeMismatch ((Lib.vsnd x.calledArg.Position) + 1)) //snd
sprintf " // %s" nameOrOneBasedIndexMessage
| _ -> ""

Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/FSharp.Build/Fsc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ type public Fsc () as this =

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

// expose this to internal components (for nunit testing)
member internal fsc.InternalGenerateCommandLineCommands() =
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/FSharp.Build/Fsi.fs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ type public Fsi () as this =

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

// expose this to internal components (for nunit testing)
member internal fsi.InternalGenerateCommandLineCommands() =
Expand Down
11 changes: 11 additions & 0 deletions src/fsharp/FSharp.Core/prim-types.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,7 @@ namespace Microsoft.FSharp.Core
// gives reliable results on null values.
System.String.CompareOrdinal((# "" x : string #),(# "" y : string #))
when 'T : decimal = System.Decimal.Compare((# "" x:decimal #), (# "" y:decimal #))
when 'T : DateTime = System.DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #))


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

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

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

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

/// Generic greater-than-or-equal with static optimizations for some well-known cases.
let inline GenericGreaterOrEqualFast (x:'T) (y:'T) =
Expand All @@ -1199,6 +1204,8 @@ namespace Microsoft.FSharp.Core
when 'T : float32 = not (# "clt.un" x y : bool #)
when 'T : char = not (# "clt" x y : bool #)
when 'T : decimal = System.Decimal.op_GreaterThanOrEqual ((# "" x:decimal #), (# "" y:decimal #))

when 'T : DateTime = DateTime.Compare((# "" x : DateTime #), (# "" y : DateTime #)) >= 0


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

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


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


let inline GenericInequalityFast (x:'T) (y:'T) = (not(GenericEqualityFast x y) : bool)
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/MethodCalls.fs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type CallerArg<'T> =

/// Represents the information about an argument in the method being called
type CalledArg =
{ Position: (int * int)
{ Position: struct (int * int)
IsParamArray : bool
OptArgInfo : OptionalArgInfo
CallerInfo : CallerInfo
Expand Down Expand Up @@ -303,7 +303,7 @@ let MakeCalledArgs amap m (minfo: MethInfo) minst =
// Mark up the arguments with their position, so we can sort them back into order later
let paramDatas = minfo.GetParamDatas(amap, m, minst)
paramDatas |> List.mapiSquared (fun i j (ParamData(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfoFlags, nmOpt, reflArgInfo, typeOfCalledArg)) ->
{ Position=(i,j)
{ Position=struct(i,j)
IsParamArray=isParamArrayArg
OptArgInfo=optArgInfo
CallerInfo = callerInfoFlags
Expand Down
1 change: 1 addition & 0 deletions src/fsharp/lib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -564,3 +564,4 @@ type MaybeLazy<'T> =
| Strict x -> x
| Lazy x -> x.Force()

let inline vsnd ((_, y): struct('T * 'T)) = y
4 changes: 2 additions & 2 deletions src/fsharp/service/ServiceLexing.fs
Original file line number Diff line number Diff line change
Expand Up @@ -616,15 +616,15 @@ type FSharpLineTokenizer(lexbuf: UnicodeLexing.Lexbuf,
| Some mx when rightp.Line > leftp.Line -> mx
| _ -> rightp.Column
let rightc = rightc - 1
leftc, rightc
struct (leftc, rightc)

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

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