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

Commit406c9d6

Browse files
KevinRansomKevin Ransom
authored and
Kevin Ransom
committed
refactor
1 parentc0de51d commit406c9d6

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

‎src/absil/il.fs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,8 +1558,7 @@ type ILFieldDef =
15581558
memberx.WithStatic(condition)={ xwith Attributes= x.Attributes|> conditionalAdd condition FieldAttributes.Static}
15591559
memberx.WithSpecialName(condition)={ xwith Attributes= x.Attributes|> conditionalAdd condition(FieldAttributes.SpecialName||| FieldAttributes.RTSpecialName)}
15601560
memberx.WithNotSerialized(condition)={ xwith Attributes= x.Attributes|> conditionalAdd condition FieldAttributes.NotSerialized}
1561-
memberx.WithLiteral(condition)={ xwith Attributes= x.Attributes|> conditionalAdd condition FieldAttributes.Literal}
1562-
memberx.WithHasDefault(condition)={ xwith Attributes= x.Attributes|> conditionalAdd condition FieldAttributes.HasDefault}
1561+
memberx.WithLiteralDefaultValue(literal)={ xwith LiteralValue= literal; Attributes= x.Attributes|> conditionalAdd literal.IsSome(FieldAttributes.Literal||| FieldAttributes.HasDefault)}
15631562
memberx.WithHasFieldMarshal(condition)={ xwith Attributes= x.Attributes|> conditionalAdd condition FieldAttributes.HasFieldMarshal}
15641563

15651564

‎src/absil/il.fsi‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,8 +1138,7 @@ type ILFieldDef =
11381138
memberWithStatic:bool->ILFieldDef
11391139
memberWithSpecialName:bool->ILFieldDef
11401140
memberWithNotSerialized:bool->ILFieldDef
1141-
memberWithLiteral:bool->ILFieldDef
1142-
memberWithHasDefault:bool->ILFieldDef
1141+
memberWithLiteralDefaultValue:ILFieldInit option->ILFieldDef
11431142
memberWithHasFieldMarshal:bool->ILFieldDef
11441143

11451144
/// Tables of fields. Logically equivalent to a list of fields but

‎src/fsharp/IlxGen.fs‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4742,7 +4742,7 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta
47424742
letilFieldDef= mkILStaticField(fspec.Name, fty, None, None, access)
47434743
letilFieldDef=
47444744
match vref.LiteralValuewith
4745-
| Some konst->{(ilFieldDef.WithHasDefault(true)).WithLiteral(true)with LiteralValue=Some(GenFieldInit m konst)}
4745+
| Some konst-> ilFieldDef.WithLiteralDefaultValue(Some(GenFieldInit m konst))
47464746
| None-> ilFieldDef
47474747

47484748
letilFieldDef=
@@ -6347,8 +6347,8 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) =
63476347
{ Name= ilFieldName
63486348
Type= ilPropType
63496349
Attributes=enum0
6350-
Data= None
6351-
LiteralValue=literalValue
6350+
Data= None
6351+
LiteralValue=None
63526352
Offset= ilFieldOffset
63536353
Marshal= ilFieldMarshal
63546354
CustomAttrs= mkILCustomAttrs(GenAttrs cenv eenv fattribs@ extraAttribs)}
@@ -6357,8 +6357,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) =
63576357
.WithStatic(isStatic)
63586358
.WithSpecialName(ilFieldName="value__"&& tycon.IsEnumTycon)
63596359
.WithNotSerialized(ilNotSerialized)
6360-
.WithLiteral(fspec.LiteralValue.IsSome)
6361-
.WithHasDefault(literalValue.IsSome)
6360+
.WithLiteralDefaultValue(literalValue)
63626361
.WithHasFieldMarshal(ilFieldMarshal.IsSome)
63636362
yield fdef
63646363

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp