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

Commitff078e9

Browse files
authored
Add entity.DeclaringEntity to F# Compiler Service (dotnet#4633)
* Add DeclaringEntity* extend tests to cover namespaces* extend tests to cover namespaces* build on Mono 5.10* bump FCS version* various comments and debugging improvements* code review
1 parent8388cf5 commitff078e9

28 files changed

+906
-647
lines changed

‎fcs/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ which does things like:
6060
You can push the packages if you have permissions, either automatically using``build Release`` or manually
6161

6262
set APIKEY=...
63-
..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.22.0.2.nupkg %APIKEY% -Source https://nuget.org
64-
..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.MSBuild.v12.22.0.2.nupkg %APIKEY% -Source https://nuget.org
65-
..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.ProjectCracker.22.0.2.nupkg %APIKEY% -Source https://nuget.org
63+
..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.22.0.3.nupkg %APIKEY% -Source https://nuget.org
64+
..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.MSBuild.v12.22.0.3.nupkg %APIKEY% -Source https://nuget.org
65+
..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.ProjectCracker.22.0.3.nupkg %APIKEY% -Source https://nuget.org
6666

6767

6868
###Use of Paket and FAKE

‎fcs/RELEASE_NOTES.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
####22.0.3
2+
*[Add entity.DeclaringEntity](https://github.com/Microsoft/visualfsharp/pull/4633),[FCS feature request](https://github.com/fsharp/FSharp.Compiler.Service/issues/830)
3+
14
####22.0.2
25
* Use correct version number in DLLs (needed untilhttps://github.com/Microsoft/visualfsharp/issues/3113 is fixed)
36

‎fcs/fcs.props‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<ProjectToolsVersion="4.0"DefaultTargets="Build"xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
44
<PropertyGroup>
55

6-
<VersionPrefix>22.0.2</VersionPrefix>
6+
<VersionPrefix>22.0.3</VersionPrefix>
77
<OtherFlags>--version:$(VersionPrefix)</OtherFlags>
88
<!-- FSharp.Compiler.Tools is currently only used to get a working FSI.EXE to execute some scripts during the build-->
99
<!-- The LKG FSI.EXE requires MSBuild 15 to be installed, which is painful-->

‎src/absil/il.fs‎

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,6 @@ type ILAssemblyRef(data) =
408408

409409
ILAssemblyRef.Create(aname.Name,None,publicKey,retargetable,version,locale)
410410

411-
412-
413411
memberaref.QualifiedName=
414412
letb=new System.Text.StringBuilder(100)
415413
letadd(s:string)=(b.Append(s)|> ignore)
@@ -478,13 +476,6 @@ type ILScopeRef =
478476
memberx.AssemblyRef=match xwith ILScopeRef.Assembly x-> x|_-> failwith"not an assembly reference"
479477

480478
memberscoref.QualifiedName=
481-
match scorefwith
482-
| ILScopeRef.Local->""
483-
| ILScopeRef.Module mref->"module"^mref.Name
484-
| ILScopeRef.Assembly arefwhen aref.Name="mscorlib"->""
485-
| ILScopeRef.Assembly aref-> aref.QualifiedName
486-
487-
memberscoref.QualifiedNameWithNoShortPrimaryAssembly=
488479
match scorefwith
489480
| ILScopeRef.Local->""
490481
| ILScopeRef.Module mref->"module"+mref.Name
@@ -602,18 +593,12 @@ type ILTypeRef =
602593
membertref.BasicQualifiedName=
603594
(String.concat"+"(tref.Enclosing@[ tref.Name])).Replace(",",@"\,")
604595

605-
membertref.AddQualifiedNameExtensionWithNoShortPrimaryAssembly(basic)=
606-
letsco= tref.Scope.QualifiedNameWithNoShortPrimaryAssembly
607-
if sco=""then basicelse String.concat","[basic;sco]
608-
609-
membertref.QualifiedNameWithNoShortPrimaryAssembly=
610-
tref.AddQualifiedNameExtensionWithNoShortPrimaryAssembly(tref.BasicQualifiedName)
611-
612-
membertref.QualifiedName=
613-
letbasic= tref.BasicQualifiedName
596+
membertref.AddQualifiedNameExtension(basic)=
614597
letsco= tref.Scope.QualifiedName
615598
if sco=""then basicelse String.concat","[basic;sco]
616599

600+
membertref.QualifiedName=
601+
tref.AddQualifiedNameExtension(tref.BasicQualifiedName)
617602

618603
overridex.ToString()= x.FullName
619604

@@ -624,22 +609,30 @@ and
624609
{ tspecTypeRef:ILTypeRef;
625610
/// The type instantiation if the type is generic.
626611
tspecInst:ILGenericArgs}
612+
627613
memberx.TypeRef=x.tspecTypeRef
614+
628615
memberx.Scope=x.TypeRef.Scope
616+
629617
memberx.Enclosing=x.TypeRef.Enclosing
618+
630619
memberx.Name=x.TypeRef.Name
620+
631621
memberx.GenericArgs=x.tspecInst
622+
632623
static memberCreate(tref,inst)={ tspecTypeRef=tref; tspecInst=inst}
624+
633625
overridex.ToString()= x.TypeRef.ToString()+if isNil x.GenericArgsthen""else"<...>"
626+
634627
memberx.BasicQualifiedName=
635628
lettc= x.TypeRef.BasicQualifiedName
636629
if isNil x.GenericArgsthen
637630
tc
638631
else
639-
tc+"["+ String.concat","(x.GenericArgs|> List.map(fun arg->"["+ arg.QualifiedNameWithNoShortPrimaryAssembly+"]"))+"]"
632+
tc+"["+ String.concat","(x.GenericArgs|> List.map(fun arg->"["+ arg.QualifiedName+"]"))+"]"
640633

641-
memberx.AddQualifiedNameExtensionWithNoShortPrimaryAssembly(basic)=
642-
x.TypeRef.AddQualifiedNameExtensionWithNoShortPrimaryAssembly(basic)
634+
memberx.AddQualifiedNameExtension(basic)=
635+
x.TypeRef.AddQualifiedNameExtension(basic)
643636

644637
memberx.FullName=x.TypeRef.FullName
645638

@@ -666,19 +659,19 @@ and [<RequireQualifiedAccess; StructuralEquality; StructuralComparison>]
666659
| ILType.Byref_ty-> failwith"unexpected byref type"
667660
| ILType.FunctionPointer_mref-> failwith"unexpected function pointer type"
668661

669-
memberx.AddQualifiedNameExtensionWithNoShortPrimaryAssembly(basic)=
662+
memberx.AddQualifiedNameExtension(basic)=
670663
match xwith
671664
| ILType.TypeVar_n-> basic
672-
| ILType.Modified(_,_ty1,ty2)-> ty2.AddQualifiedNameExtensionWithNoShortPrimaryAssembly(basic)
673-
| ILType.Array(ILArrayShape(_s),ty)-> ty.AddQualifiedNameExtensionWithNoShortPrimaryAssembly(basic)
674-
| ILType.Value tr| ILType.Boxed tr-> tr.AddQualifiedNameExtensionWithNoShortPrimaryAssembly(basic)
665+
| ILType.Modified(_,_ty1,ty2)-> ty2.AddQualifiedNameExtension(basic)
666+
| ILType.Array(ILArrayShape(_s),ty)-> ty.AddQualifiedNameExtension(basic)
667+
| ILType.Value tr| ILType.Boxed tr-> tr.AddQualifiedNameExtension(basic)
675668
| ILType.Void-> failwith"void"
676669
| ILType.Ptr_ty-> failwith"unexpected pointer type"
677670
| ILType.Byref_ty-> failwith"unexpected byref type"
678671
| ILType.FunctionPointer_mref-> failwith"unexpected function pointer type"
679672

680-
memberx.QualifiedNameWithNoShortPrimaryAssembly=
681-
x.AddQualifiedNameExtensionWithNoShortPrimaryAssembly(x.BasicQualifiedName)
673+
memberx.QualifiedName=
674+
x.AddQualifiedNameExtension(x.BasicQualifiedName)
682675

683676
memberx.TypeSpec=
684677
match xwith
@@ -3301,7 +3294,7 @@ let rec encodeCustomAttrElemType x =
33013294
| ILType.Boxed tspecwhen tspec.Name= tname_String->[| et_STRING|]
33023295
| ILType.Boxed tspecwhen tspec.Name= tname_Object->[|0x51uy|]
33033296
| ILType.Boxed tspecwhen tspec.Name= tname_Type->[|0x50uy|]
3304-
| ILType.Value tspec-> Array.append[|0x55uy|](encodeCustomAttrString tspec.TypeRef.QualifiedNameWithNoShortPrimaryAssembly)
3297+
| ILType.Value tspec-> Array.append[|0x55uy|](encodeCustomAttrString tspec.TypeRef.QualifiedName)
33053298
| ILType.Array(shape, elemType)when shape= ILArrayShape.SingleDimensional->
33063299
Array.append[| et_SZARRAY|](encodeCustomAttrElemType elemType)
33073300
|_-> failwith"encodeCustomAttrElemType: unrecognized custom element type"
@@ -3372,8 +3365,8 @@ let rec encodeCustomAttrPrimValue ilg c =
33723365
| ILAttribElem.UInt64 x-> u64AsBytes x
33733366
| ILAttribElem.Single x-> ieee32AsBytes x
33743367
| ILAttribElem.Double x-> ieee64AsBytes x
3375-
| ILAttribElem.Type(Some ty)-> encodeCustomAttrString ty.QualifiedNameWithNoShortPrimaryAssembly
3376-
| ILAttribElem.TypeRef(Some tref)-> encodeCustomAttrString tref.QualifiedNameWithNoShortPrimaryAssembly
3368+
| ILAttribElem.Type(Some ty)-> encodeCustomAttrString ty.QualifiedName
3369+
| ILAttribElem.TypeRef(Some tref)-> encodeCustomAttrString tref.QualifiedName
33773370
| ILAttribElem.Array(_,elems)->
33783371
[|yield! i32AsBytes elems.Length;for elemin elemsdoyield! encodeCustomAttrPrimValue ilg elem|]
33793372

@@ -3427,7 +3420,7 @@ let mkPermissionSet (ilg: ILGlobals) (action,attributes: list<(ILTypeRef * (stri
34273420
[|yield(byte'.');
34283421
yield! z_unsigned_int attributes.Length;
34293422
for(tref:ILTypeRef,props)in attributesdo
3430-
yield! encodeCustomAttrString tref.QualifiedNameWithNoShortPrimaryAssembly
3423+
yield! encodeCustomAttrString tref.QualifiedName
34313424
letbytes=
34323425
[|yield! z_unsigned_int props.Length;
34333426
for(nm,typ,value)in propsdo

‎src/absil/il.fsi‎

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,26 +184,32 @@ type ILTypeRef =
184184

185185
member QualifiedName: string
186186

187-
#if!NO_EXTENSIONTYPING
188-
member QualifiedNameWithNoShortPrimaryAssembly: string
189-
#endif
190-
191187
interface System.IComparable
192188
193189
/// Type specs and types.
194190
[<Sealed>]
195191
type ILTypeSpec=
192+
/// Create an ILTypeSpec.
196193
static memberCreate:typeRef:ILTypeRef* instantiation:ILGenericArgs-> ILTypeSpec
197194

198195
/// Which type is being referred to?
199196
member TypeRef: ILTypeRef
200197

201198
/// The type instantiation if the type is generic, otherwise empty
202199
member GenericArgs: ILGenericArgs
200+
201+
/// Where is the type, i.e. is it in this module, in another module in this assembly or in another assembly?
203202
member Scope: ILScopeRef
203+
204+
/// The list of enclosing type names for a nested type. If non-nil then the first of these also contains the namespace.
204205
member Enclosing: string list
206+
207+
/// The name of the type. This also contains the namespace if Enclosing is empty.
205208
member Name: string
209+
210+
/// The name of the type in the assembly using the '.' notation for nested types.
206211
member FullName: string
212+
207213
interface System.IComparable
208214

209215
and
@@ -244,13 +250,20 @@ and
244250
ILType
245251

246252
memberTypeSpec:ILTypeSpec
253+
247254
memberBoxity:ILBoxity
255+
248256
memberTypeRef:ILTypeRef
257+
249258
memberIsNominal:bool
259+
250260
memberGenericArgs:ILGenericArgs
261+
251262
memberIsTyvar:bool
263+
252264
memberBasicQualifiedName:string
253-
memberQualifiedNameWithNoShortPrimaryAssembly:string
265+
266+
memberQualifiedName:string
254267

255268
and [<StructuralEquality; StructuralComparison>]
256269
ILCallingSignature=
@@ -271,13 +284,21 @@ type ILMethodRef =
271284
static memberCreate:enclosingTypeRef:ILTypeRef* callingConv: ILCallingConv* name: string* genericArity: int* argTypes: ILTypes* returnType: ILType-> ILMethodRef
272285

273286
member DeclaringTypeRef: ILTypeRef
287+
274288
member CallingConv: ILCallingConv
289+
275290
member Name: string
291+
276292
member GenericArity: int
293+
277294
member ArgCount: int
295+
278296
member ArgTypes: ILTypes
297+
279298
member ReturnType: ILType
299+
280300
member CallingSignature: ILCallingSignature
301+
281302
interface System.IComparable
282303
283304
/// Formal identities of fields.
@@ -295,13 +316,21 @@ type ILMethodSpec =
295316
static memberCreate:ILType* ILMethodRef* ILGenericArgs-> ILMethodSpec
296317

297318
member MethodRef: ILMethodRef
319+
298320
member DeclaringType: ILType
321+
299322
member GenericArgs: ILGenericArgs
323+
300324
member CallingConv: ILCallingConv
325+
301326
member GenericArity: int
327+
302328
member Name: string
329+
303330
member FormalArgTypes: ILTypes
331+
304332
member FormalReturnType: ILType
333+
305334
interface System.IComparable
306335
307336
/// Field specs. The data given for a ldfld, stfld etc. instruction.
@@ -311,8 +340,11 @@ type ILFieldSpec =
311340
DeclaringType:ILType}
312341

313342
memberDeclaringTypeRef:ILTypeRef
343+
314344
memberName:string
345+
315346
memberFormalType:ILType
347+
316348
memberActualType:ILType
317349

318350
/// ILCode labels. In structured code each code label refers to a basic block somewhere in the code of the method.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp