We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent edc16d0 commit 0be33abCopy full SHA for 0be33ab
src/Compiler/Checking/TailCallChecks.fs
@@ -47,8 +47,16 @@ type TailCall =
47
static member YesFromVal (g: TcGlobals) (v: Val) = TailCall.Yes(TailCall.IsVoidRet g v)
48
49
static member YesFromExpr (g: TcGlobals) (expr: Expr) =
50
+ let yesFromTType (t: TType) =
51
+ if isUnitTy g t then
52
+ TailCall.Yes TailCallReturnType.MustReturnVoid
53
+ else
54
+ TailCall.Yes TailCallReturnType.NonVoid
55
+
56
match expr with
57
| ValUseAtApp(valRef, _) -> TailCall.Yes(TailCall.IsVoidRet g valRef.Deref)
58
+ | Expr.Const(constType = constType) -> yesFromTType constType
59
+ | Expr.Match(exprType = exprType) -> yesFromTType exprType
60
| _ -> TailCall.Yes TailCallReturnType.NonVoid
61
62
member x.AtExprLambda =
0 commit comments