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

Commit0b9091a

Browse files
forkiKevinRansom
authored andcommitted
Avoid scanning for attributes if possible (#3158)
1 parent3907fcc commit0b9091a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎src/fsharp/TypeChecker.fs‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10227,15 +10227,15 @@ and TcNormalizedBinding declKind (cenv:cenv) env tpenv overallTy safeThisValOpt
1022710227
if (not isMutable || isThreadStatic) then
1022810228
errorR(Error(FSComp.SR.tcVolatileFieldsMustBeMutable(),mBinding))
1022910229

10230-
if isFixed then
10231-
if declKind <> ExpressionBinding || isInline || isMutable then
10232-
errorR(Error(FSComp.SR.tcFixedNotAllowed(),mBinding))
10230+
if isFixed && (declKind <> ExpressionBinding || isInline || isMutable) then
10231+
errorR(Error(FSComp.SR.tcFixedNotAllowed(),mBinding))
1023310232

10234-
if HasFSharpAttributeOpt cenv.g cenv.g.attrib_DllImportAttribute valAttribs then
10235-
if not declKind.CanBeDllImport || (match memberFlagsOpt with Some memberFlags -> memberFlags.IsInstance | _ -> false) then
10236-
errorR(Error(FSComp.SR.tcDllImportNotAllowed(),mBinding))
10233+
if (not declKind.CanBeDllImport || (match memberFlagsOpt with Some memberFlags -> memberFlags.IsInstance | _ -> false)) &&
10234+
HasFSharpAttributeOpt cenv.g cenv.g.attrib_DllImportAttribute valAttribs
10235+
then
10236+
errorR(Error(FSComp.SR.tcDllImportNotAllowed(),mBinding))
1023710237

10238-
if HasFSharpAttribute cenv.g cenv.g.attrib_ConditionalAttribute valAttribs && Option.isNone memberFlagsOpt then
10238+
ifOption.isNone memberFlagsOpt &&HasFSharpAttribute cenv.g cenv.g.attrib_ConditionalAttribute valAttribs then
1023910239
errorR(Error(FSComp.SR.tcConditionalAttributeRequiresMembers(),mBinding))
1024010240

1024110241
if HasFSharpAttribute cenv.g cenv.g.attrib_EntryPointAttribute valAttribs then

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp