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

Commitc88d3f4

Browse files
dsymeTIHan
authored andcommitted
add test and fix bug# (#4077)
1 parentbfb5762 commitc88d3f4

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

‎src/fsharp/TypeChecker.fs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12679,14 +12679,16 @@ module IncrClassChecking =
1267912679
| Expr.TyLambda (_, tps, b, m, returnTy) -> tps, [], b, returnTy, m
1268012680
| e -> [], [], e, (tyOfExpr cenv.g e), e.Range
1268112681

12682-
let chooseTps = chooseTps @ freeChoiceTypars
12682+
let chooseTps = chooseTps @ (ListSet.subtract typarEq freeChoiceTypars methodVal.Typars)
12683+
1268312684
// Add the 'this' variable as an argument
1268412685
let tauExpr, tauTy =
1268512686
if isStatic then
1268612687
tauExpr, tauTy
1268712688
else
1268812689
let e = mkLambda m thisVal (tauExpr, tauTy)
1268912690
e, tyOfExpr cenv.g e
12691+
1269012692
// Replace the type parameters that used to be on the rhs with
1269112693
// the full set of type parameters including the type parameters of the enclosing class
1269212694
let rhsExpr = mkTypeLambda m methodVal.Typars (mkTypeChoose m chooseTps tauExpr, tauTy)

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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,6 +1791,51 @@ module SRTPFix =
17911791
printfn "%A" <| replace 'q' (test("HI"))
17921792
*)
17931793

1794+
// See https://github.com/Microsoft/visualfsharp/issues/4040
1795+
moduleInferenceRegression4040=
1796+
typeFoo()=
1797+
static lettest(t:'T):'T list=
1798+
letb:Bar<'T>=new Bar<'T>(t)
1799+
[b.Value]
1800+
1801+
static memberTest(t:int)= test t
1802+
1803+
andBar<'U>(value:'U)=
1804+
member__.Value= value
1805+
1806+
printfn"%A"(Foo.Test42)
1807+
1808+
1809+
// See https://github.com/Microsoft/visualfsharp/issues/4040
1810+
moduleInferenceRegression4040b=
1811+
typeFoo()=
1812+
static lettest(t:'T):'T list=
1813+
letb:Bar<'T>=new Bar<'T>(t)
1814+
[b.Value]
1815+
1816+
static memberTest(t:int)= test t
1817+
1818+
andBar<'T>(value:'T)=
1819+
member__.Value= value
1820+
1821+
printfn"%A"(Foo.Test42)
1822+
1823+
// See https://github.com/Microsoft/visualfsharp/issues/4040
1824+
moduleInferenceRegression4040C=
1825+
typeFoo()=
1826+
static lettest(t:'T):'T list=
1827+
letb:Bar<'T>=new Bar<'T>(t)
1828+
[b.Value]
1829+
1830+
static memberTest(t:int)= test t
1831+
1832+
andBar<'U>(value:'U)=
1833+
member__.Value:'U= value
1834+
1835+
printfn"%A"(Foo.Test42)
1836+
1837+
1838+
17941839
#if TESTS_AS_APP
17951840
letRUN()=!failures
17961841
#else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp