Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
ed8393c8
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,发现更多精彩内容 >>
提交
ed8393c8
编写于
3月 09, 2018
作者:
S
Steffen Forkmann
提交者:
Kevin Ransom (msft)
3月 08, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
No need to decompile coreDisplayName all the time (#4443)
上级
792dbe58
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
13 deletion
+15
-13
src/fsharp/TypeChecker.fs
src/fsharp/TypeChecker.fs
+15
-13
未找到文件。
src/fsharp/TypeChecker.fs
浏览文件 @
ed8393c8
...
...
@@ -1405,32 +1405,34 @@ let ComputeAccessAndCompPath env declKindOpt m vis overrideVis actualParent =
let cpath = if accessModPermitted then Some env.eCompPath else None
vis, cpath
let CheckForAbnormalOperatorNames cenv (idRange:range)
opName isMember =
if (idRange.EndColumn - idRange.StartColumn <= 5) &&
not cenv.g.compilingFslib
let CheckForAbnormalOperatorNames cenv (idRange:range)
coreDisplayName (memberInfoOpt: ValMemberInfo option) =
if (idRange.EndColumn - idRange.StartColumn <= 5) &&
not cenv.g.compilingFslib
then
match opName with
let opName = DecompileOpName coreDisplayName
let isMember = memberInfoOpt.IsSome
match opName with
| PrettyNaming.Relational ->
if isMember then
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMethodNameForRelationalOperator(opName,
(CompileOpName opName)
), idRange))
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMethodNameForRelationalOperator(opName,
coreDisplayName
), idRange))
else
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinitionRelational
(opName)
, idRange))
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinitionRelational
opName
, idRange))
| PrettyNaming.Equality ->
if isMember then
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMethodNameForEquality(opName,
(CompileOpName opName)
), idRange))
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMethodNameForEquality(opName,
coreDisplayName
), idRange))
else
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinitionEquality
(opName)
, idRange))
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinitionEquality
opName
, idRange))
| PrettyNaming.Control ->
if isMember then
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMemberName(opName,
(CompileOpName opName)
), idRange))
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMemberName(opName,
coreDisplayName
), idRange))
else
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinition
(opName)
, idRange))
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinition
opName
, idRange))
| PrettyNaming.Indexer ->
if not isMember then
error(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidIndexOperatorDefinition
(opName)
, idRange))
error(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidIndexOperatorDefinition
opName
, idRange))
| PrettyNaming.FixedTypes ->
if isMember then
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMemberNameFixedTypes
(opName)
, idRange))
warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMemberNameFixedTypes
opName
, idRange))
| PrettyNaming.Other -> ()
let MakeAndPublishVal cenv env (altActualParent, inSig, declKind, vrec, (ValScheme(id, typeScheme, topValData, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, compgen, isIncrClass, isTyFunc, hasDeclaredTypars)), attrs, doc, konst, isGeneratedEventVal) =
...
...
@@ -1537,7 +1539,7 @@ let MakeAndPublishVal cenv env (altActualParent, inSig, declKind, vrec, (ValSche
(hasDeclaredTypars || inSig), isGeneratedEventVal, konst, actualParent)
CheckForAbnormalOperatorNames cenv id.idRange
(DecompileOpName vspec.CoreDisplayName) (Option.isSome memberInfoOpt)
CheckForAbnormalOperatorNames cenv id.idRange
vspec.CoreDisplayName memberInfoOpt
PublishValueDefn cenv env declKind vspec
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录