Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
4dba9f76
F
fsharp
项目概览
dotNET Platform
/
fsharp
12 个月 前同步成功
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fsharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4dba9f76
编写于
4月 07, 2017
作者:
D
Don Syme
提交者:
Kevin Ransom (msft)
4月 07, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix 2416 regression (#2816)
上级
dfc3f9eb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
4 deletion
+24
-4
src/fsharp/TypeChecker.fs
src/fsharp/TypeChecker.fs
+15
-4
tests/fsharp/core/syntax/test.fsx
tests/fsharp/core/syntax/test.fsx
+9
-0
未找到文件。
src/fsharp/TypeChecker.fs
浏览文件 @
4dba9f76
...
...
@@ -8236,7 +8236,7 @@ and TcSequenceExpression cenv env tpenv comp overallTy m =
// unambiguously implies a function type
//-------------------------------------------------------------------------
and Propagate
ThenTcDelayed cenv overallTy env tpenv mExpr expr exprty (atomicFlag:ExprAtomicFlag)
delayed =
and Propagate
cenv overallTy env tpenv (expr: ApplicableExpr) exprty
delayed =
let rec propagate delayedList mExpr exprty =
match delayedList with
...
...
@@ -8266,6 +8266,9 @@ and PropagateThenTcDelayed cenv overallTy env tpenv mExpr expr exprty (atomicFla
error (NotAFunction(denv,overallTy,mExpr,mArg))
propagate delayed expr.Range exprty
and PropagateThenTcDelayed cenv overallTy env tpenv mExpr expr exprty (atomicFlag:ExprAtomicFlag) delayed =
Propagate cenv overallTy env tpenv expr exprty delayed
TcDelayed cenv overallTy env tpenv mExpr expr exprty atomicFlag delayed
...
...
@@ -8677,10 +8680,18 @@ and TcItemThen cenv overallTy env tpenv (item,mItem,rest,afterOverloadResolution
let expr = Expr.Op(TOp.TraitCall(traitInfo), [], ves, mItem)
let expr = mkLambdas mItem [] vs (expr,retTy)
let resultExpr = PropagateThenTcDelayed cenv overallTy env tpenv mItem (MakeApplicableExprNoFlex cenv expr) (tyOfExpr cenv.g expr) ExprAtomicFlag.NonAtomic delayed
// Add the constraint after the arguments have been checked to allow annotations to kick in on rigid type parameters
Propagate cenv overallTy env tpenv (MakeApplicableExprNoFlex cenv expr) (tyOfExpr cenv.g expr) delayed
let delayed1, delayed2 = List.takeWhile (function (DelayedApp _) -> true | _ -> false) delayed, List.skipWhile (function (DelayedApp _) -> true | _ -> false) delayed
let intermediateTy = if isNil delayed2 then overallTy else NewInferenceType ()
let resultExpr, tpenv = TcDelayed cenv intermediateTy env tpenv mItem (MakeApplicableExprNoFlex cenv expr) (tyOfExpr cenv.g expr) ExprAtomicFlag.NonAtomic delayed1
// Add the constraint after the application arguments have been checked to allow annotations to kick in on rigid type parameters
AddCxMethodConstraint env.DisplayEnv cenv.css mItem NoTrace traitInfo
resultExpr
let resultExpr2, tpenv2 = TcDelayed cenv overallTy env tpenv mItem (MakeApplicableExprNoFlex cenv resultExpr) intermediateTy ExprAtomicFlag.NonAtomic delayed2
resultExpr2, tpenv2
| Item.DelegateCtor typ ->
...
...
tests/fsharp/core/syntax/test.fsx
浏览文件 @
4dba9f76
...
...
@@ -54,6 +54,15 @@ module CheckDynamicOperatorsOnTypes =
let
hw
:
string
=
foo
?
world
let
hw2
:
unit
=
foo
?
world
<-
"3"
module
CheckDynamicOperatorsOnTypesUnconstrained
=
type
OpDynamic
()
=
static
member
(
?
)
(
x
,
n
)
=
x
member
x
.
Prop
=
1
let
f
()
=
let
op
=
OpDynamic
()
op
?
Hello
.
Prop
// Copyright (c) Microsoft Corporation 2005-2006. .
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录