Skip to content

Commit 95ba9c8

Browse files
isaacabrahamlatkin
authored andcommitted
Fix false escaping type parameter check error
closes dotnet/fsharp#613 fixes dotnet/fsharp#583 commit 14de02b29894ec8757757fdbd86a5476fa5e3f39 Author: latkin <latkin@microsoft.com> Date: Wed Sep 16 15:36:05 2015 -0700 Add test case commit 02dd52e857d3b9754f51f45921a24f1c32729328 Author: Isaac Abraham <isaac.abraham@gmail.com> Date: Fri Sep 4 11:40:50 2015 +0200 Fixes dotnet/fsharp#583.
1 parent 499b2c3 commit 95ba9c8

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

src/fsharp/PostInferenceChecks.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,8 @@ and CheckExprInContext (cenv:cenv) (env:env) expr (context:ByrefCallContext) =
632632
let ty = tryMkForallTy tps rty in
633633
CheckLambdas None cenv env false topValInfo false expr m ty
634634

635-
| Expr.TyChoose(_,e1,_) ->
635+
| Expr.TyChoose(tps,e1,_) ->
636+
let env = BindTypars cenv.g env tps
636637
CheckExpr cenv env e1
637638

638639
| Expr.Match(_,_,dtree,targets,m,ty) ->

tests/fsharp/typecheck/sigs/build.bat

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
@if "%_echo%"=="" echo off
22

33
setlocal
4-
REM Configure the sample, i.e. where to find the F# compiler and C# compiler.
54

5+
REM Configure the sample, i.e. where to find the F# compiler and C# compiler.
66
call %~d0%~p0..\..\..\config.bat
77

8+
"%FSC%" %fsc_flags% --target:exe -o:pos22.exe pos22.fs
9+
@if ERRORLEVEL 1 goto Error
10+
11+
"%PEVERIFY%" pos22.exe
12+
@if ERRORLEVEL 1 goto Error
13+
14+
pos22.exe
15+
@if ERRORLEVEL 1 goto Error
16+
817
call ..\..\single-neg-test.bat neg93
918
@if ERRORLEVEL 1 goto Error
1019

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// https://github.com/Microsoft/visualfsharp/issues/583
2+
3+
let rec recValNeverUsedAtRuntime = recFuncIgnoresFirstArg (fun _ -> recValNeverUsedAtRuntime) 1
4+
and recFuncIgnoresFirstArg g v = v

0 commit comments

Comments
 (0)