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

Commitb1464a7

Browse files
dsymelatkin
authored andcommitted
fix 147 - consider implicit ctors in type check env when determining what type variables can be generalized
fixesdotnet#147closesdotnet#435commit82932c6Author: Don Syme <donsyme@fastmail.fm>Date: Tue May 12 15:46:30 2015 +0100 update baselinecommitf38e5a4Author: Don Syme <donsyme@fastmail.fm>Date: Sat May 9 20:18:16 2015 +0100 fix 147 (tests)commite18ca74Author: Don Syme <donsyme@fastmail.fm>Date: Sat May 9 20:16:06 2015 +0100 fix 147
1 parentcccf5b9 commitb1464a7

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

‎src/fsharp/tc.fs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12743,6 +12743,14 @@ module TyconBindingChecking = begin
1274312743
// Post letrec env
1274412744
let envFinal = AddLocalTyconRefs false g cenv.amap scopem tcrefsWithCSharpExtensionMembers envInitial
1274512745
let envFinal = AddLocalVals cenv.tcSink scopem prelimRecValues envFinal
12746+
let envFinal =
12747+
let ctorVals =
12748+
[ for (TyconBindingsPassBGroup(_tcref, defnBs)) in defnsBs do
12749+
for defnB in defnBs do
12750+
match defnB with
12751+
| PassBIncrClassCtor (incrClassCtorLhs, _) -> yield incrClassCtorLhs.InstanceCtorVal
12752+
| _ -> () ]
12753+
AddLocalVals cenv.tcSink scopem ctorVals envFinal
1274612754

1274712755
binds,envFinal,tpenv
1274812756

‎tests/fsharp/typecheck/sigs/build.bat‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ call %~d0%~p0..\..\..\config.bat
88
"%FSC%" --noframework -r:"%FSCOREDLLPATH%" -r:"%X86_PROGRAMFILES%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" -r:"%X86_PROGRAMFILES%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll" -r:"%X86_PROGRAMFILES%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.dll" -r:"%X86_PROGRAMFILES%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" -r:"%X86_PROGRAMFILES%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Numerics.dll" -a -o:pos21.dll pos21.fs
99
@if ERRORLEVEL1goto Error
1010

11+
call ..\..\single-neg-test.bat neg92
12+
@if ERRORLEVEL1goto Error
13+
1114
call ..\..\single-neg-test.bat neg91
1215
@if ERRORLEVEL1goto Error
1316

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
neg92.fs(10,19,10,20): typecheck error FS0064: This construct causes codeto be less generic than indicated by the type annotations. The type variable 'T has been constrainedto be type ''U'.
3+
4+
neg92.fs(9,9,9,30): typecheck error FS0670: This code isnot sufficiently generic. The type variable 'U couldnot be generalized because it would escape its scope.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
moduleTest
2+
3+
4+
moduleTest1=
5+
typeSomeClass(x: 'T)=classend
6+
//member this.P = 1
7+
//member this.X = x
8+
9+
letSomeFunc<'U>(x:'U)=
10+
SomeClass(x)
11+
12+
moduleTest2=
13+
openSystem
14+
15+
typeSomeClass(updater:#IComparable->unit)=
16+
letonLoaded()=
17+
letadorner:#IComparable= failwith""
18+
updater adorner
19+
memberthis.OnLoaded= onLoaded
20+
21+
letUpdateAdorner(updater:#IComparable->unit)=
22+
letupdater= SomeClass(updater)
23+
updater.OnLoaded

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp