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

Patch 10 #1

Merged
merged 8 commits into from
Jul 6, 2021
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
56 changes: 0 additions & 56 deletions eng/source-build-patches/0005-Fix-package-downgrade-warning.patch

This file was deleted.

4 changes: 2 additions & 2 deletions src/fsharp/DetupleArgs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -715,15 +715,15 @@ let fixupApp (penv: penv) (fx, fty, tys, args, m) =

// Is it a val app, where the val has a transform?
match fx with
| Expr.Val (vref, _, m) ->
| Expr.Val (vref, _, vm) ->
let f = vref.Deref
match hasTransfrom penv f with
| Some trans ->
// fix it
let callPattern = trans.transformCallPattern
let transformedVal = trans.transformedVal
let fCty = transformedVal.Type
let fCx = exprForVal m transformedVal
let fCx = exprForVal vm transformedVal
(* [[f tps args ]] -> transformedVal tps [[COLLAPSED: args]] *)
let env = {prefix = "arg";m = m;eg=penv.g}
let bindings = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@
<Compile Include="..\lib.fs">
<Link>Utilities\lib.fs</Link>
</Compile>
<Compile Include="..\block.fsi">
<Link>Utilities\block.fsi</Link>
</Compile>
<Compile Include="..\block.fs">
<Link>Utilities\block.fs</Link>
</Compile>
<Compile Include="..\rational.fsi">
<Link>Utilities\rational.fsi</Link>
</Compile>
Expand Down
25 changes: 13 additions & 12 deletions src/fsharp/InnerLambdasToTopLevelFuncs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -967,13 +967,14 @@ module Pass4_RewriteAssembly =
// pass4: lowertop - convert_vterm_bind on TopLevel binds
//-------------------------------------------------------------------------

let ConvertBind g (TBind(v, repr, _) as bind) =
let AdjustBindToTopVal g (TBind(v, repr, _)) =
match v.ValReprInfo with
| None -> v.SetValReprInfo (Some (InferArityOfExprBinding g AllowTypeDirectedDetupling.Yes v repr ))
| None ->
v.SetValReprInfo (Some (InferArityOfExprBinding g AllowTypeDirectedDetupling.Yes v repr ))
// Things that don't have an arity from type inference but are top-level are compiler-generated
v.SetIsCompilerGenerated(true)
| Some _ -> ()

bind

//-------------------------------------------------------------------------
// pass4: transBind (translate)
//-------------------------------------------------------------------------
Expand Down Expand Up @@ -1035,6 +1036,9 @@ module Pass4_RewriteAssembly =
| None -> List.empty // no env for this mutual binding
| Some envp -> envp.ep_pack // environment pack bindings

let forceTopBindToHaveArity penv (bind: Binding) =
if penv.topValS.Contains(bind.Var) then AdjustBindToTopVal penv.g bind

let TransBindings xisRec penv (binds: Bindings) =
let tlrBs, nonTlrBs = binds |> List.partition (fun b -> Zset.contains b.Var penv.tlrS)
let fclass = BindingGroupSharingSameReqdItems tlrBs
Expand All @@ -1045,12 +1049,9 @@ module Pass4_RewriteAssembly =
// QUERY: we repeat this logic in LowerCallsAndSeqs. Do we really need to do this here?
// QUERY: yes and no - if we don't, we have an unrealizable term, and many decisions must
// QUERY: correlate with LowerCallsAndSeqs.
let forceTopBindToHaveArity (bind: Binding) =
if penv.topValS.Contains(bind.Var) then ConvertBind penv.g bind
else bind

let nonTlrBs = nonTlrBs |> List.map forceTopBindToHaveArity
let tlrRebinds = tlrRebinds |> List.map forceTopBindToHaveArity
nonTlrBs |> List.iter (forceTopBindToHaveArity penv)
tlrRebinds |> List.iter (forceTopBindToHaveArity penv)
// assemble into replacement bindings
let bindAs, rebinds =
match xisRec with
Expand All @@ -1067,7 +1068,7 @@ module Pass4_RewriteAssembly =
// Is it a val app, where the val f is TLR with arity wf?
// CLEANUP NOTE: should be using a mkApps to make all applications
match fx with
| Expr.Val (fvref: ValRef, _, m) when
| Expr.Val (fvref: ValRef, _, vm) when
(Zset.contains fvref.Deref penv.tlrS) &&
(let wf = Zmap.force fvref.Deref penv.arityM ("TransApp - wf", nameOfVal)
IsArityMet fvref wf tys args) ->
Expand All @@ -1078,9 +1079,9 @@ module Pass4_RewriteAssembly =
let envp = Zmap.force fc penv.envPackM ("TransApp - envp", string)
let fHat = Zmap.force f penv.fHatM ("TransApp - fHat", nameOfVal)
let tys = (List.map mkTyparTy envp.ep_etps) @ tys
let aenvExprs = List.map (exprForVal m) envp.ep_aenvs
let aenvExprs = List.map (exprForVal vm) envp.ep_aenvs
let args = aenvExprs @ args
mkApps penv.g ((exprForVal m fHat, fHat.Type), [tys], args, m) (* change, direct fHat call with closure (reqdTypars, aenvs) *)
mkApps penv.g ((exprForVal vm fHat, fHat.Type), [tys], args, m) (* change, direct fHat call with closure (reqdTypars, aenvs) *)
| _ ->
if isNil tys && isNil args then
fx
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/LexFilter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ type LexFilterImpl (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbu
| _ :: CtxtParen((BEGIN|STRUCT), _) :: CtxtSeqBlock(_, _, _) :: _ -> nextOuterMostInterestingContextIsNamespaceOrModule(offsideStack.Tail.Tail)
// at the top of the stack there is an implicit module
| _ :: [] -> true
// aTokenLExprParense is a non-namespace/module
// anything else is a non-namespace/module
| _ -> false
while not offsideStack.IsEmpty && (not(nextOuterMostInterestingContextIsNamespaceOrModule offsideStack)) &&
(match offsideStack.Head with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<dependency id="System.Threading.Thread" version="4.3.0" />
<dependency id="System.Threading.ThreadPool" version="4.3.0" />
<dependency id="System.ValueTuple" version="4.4.0" />
<dependency id="System.Buffers" version="4.5.0" />
<dependency id="System.Memory" version="4.5.3" />
<dependency id="System.Buffers" version="4.5.1" />
<dependency id="System.Memory" version="4.5.4" />
</group>
</dependencies>
<contentFiles>
Expand Down
Loading