Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit503d167

Browse files
dsymeKevinRansom
authored andcommitted
undo #3536 (#3746)
* undodotnet/fsharp#3536* undodotnet/fsharp#3536
1 parent68f4187 commit503d167

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

‎src/fsharp/LowerCallsAndSeqs.fs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ let LowerSeqExpr g amap overallExpr =
394394
| None->
395395
None
396396

397+
(*
397398
| Expr.LetRec(binds,e2,m,_)
398399
when // Restriction: only limited forms of "let rec" in sequence expressions can be handled by assignment to state local values
399400
@@ -422,7 +423,7 @@ let LowerSeqExpr g amap overallExpr =
422423
Some res4
423424
| None ->
424425
None
425-
426+
*)
426427
| Expr.Match(spBind,exprm,pt,targets,m,ty)when targets|> Array.forall(fun(TTarget(vs,_e,_spTarget))-> isNil vs)->
427428
// lower all the targets. abandon if any fail to lower
428429
lettgl= targets|> Array.map(fun(TTarget(_vs,e,_spTarget))-> Lowerfalse isTailCall noDisposeContinuationLabel currentDisposeContinuationLabel e)|> Array.toList

‎tests/fsharp/core/seq/test.fsx‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ module InfiniteSequenceExpressionsExecuteWithFiniteResources =
572572
yield! seqThreeRecCapturingOne r
573573
}
574574

575+
//
575576
// These tests will stackoverflow or out-of-memory if the above functions are not compiled to "sequence epression tailcalls",
576577
// i.e. by compiling them to a state machine
577578
lettests()=
@@ -697,8 +698,22 @@ module InfiniteSequenceExpressionsExecuteWithFiniteResources =
697698
698699
*)
699700

700-
InfiniteSequenceExpressionsExecuteWithFiniteResources.tests()
701-
701+
// Tests disabled due to bug https://github.com/Microsoft/visualfsharp/issues/3743
702+
//InfiniteSequenceExpressionsExecuteWithFiniteResources.tests()
703+
704+
// This is the additional test case related to bug https://github.com/Microsoft/visualfsharp/issues/3743
705+
letTestRecFuncInSeq()=
706+
letfactorials=
707+
[for xin0..10do
708+
let recfactorial x=
709+
match xwith
710+
|0->1
711+
| x-> x* factorial(x-1)
712+
yield factorial x
713+
]
714+
715+
for fin factorialsdo printf"%i" f
716+
TestRecFuncInSeq()
702717

703718
(*---------------------------------------------------------------------------
704719
!* wrap up

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp