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

Commit5ab7886

Browse files
committed
Remove unnecessary access modifier conversions for abstract class ctors
1 parent1251430 commit5ab7886

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

‎src/fsharp/ilxgen.fs‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5291,14 +5291,6 @@ and GenMethodForBinding
52915291
letilMethTypars= ilTypars|> List.drop mspec.EnclosingType.GenericArgs.Length
52925292
if memberInfo.MemberFlags.MemberKind= MemberKind.Constructorthen
52935293
assert(isNil ilMethTypars)
5294-
5295-
// Constructors in abstract classes become protected
5296-
letaccess=
5297-
if HasFSharpAttribute cenv.g cenv.g.attrib_AbstractClassAttribute v.MemberApparentParent.Attribsthen
5298-
ILMemberAccess.Family
5299-
else
5300-
access
5301-
53025294
letmdef= mkILCtor(access,ilParams,ilMethodBody)
53035295
letmdef={ mdefwith CustomAttrs= mkILCustomAttrs(ilAttrsThatGoOnPrimaryItem@ sourceNameAttribs@ ilAttrsCompilerGenerated)};
53045296
EmitTheMethodDef mdef

‎src/ilx/cu_erase.fs‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,13 +1037,6 @@ let rec convClassUnionDef cenv enc td cud =
10371037
// The class can be abstract if each alternative is represented by a derived type
10381038
letisAbstract=(altTypeDefs.Length= cud.cudAlternatives.Length)
10391039

1040-
// If the class is abstract make the constructor used for the subclasses protected
1041-
letctorMeths=
1042-
if isAbstractthen
1043-
ctorMeths|> List.map(fun mdef->{mdefwith Access=ILMemberAccess.Assembly})
1044-
else
1045-
ctorMeths
1046-
10471040
letexistingMeths=
10481041
td.Methods.AsList
10491042
// Filter out the F#-compiler supplied implementation of the get_Empty method. This is because we will replace

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp