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

Commite6565e6

Browse files
forkiKevinRansom
authored andcommitted
Move the name check up (dotnet#5665)
* Move the name check up* Cleanup propinfio filter* Move the name check up
1 parent709b459 commite6565e6

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

‎src/fsharp/NameResolution.fs‎

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3639,28 +3639,25 @@ let rec ResolvePartialLongIdentInType (ncenv: NameResolver) nenv isApplicableMet
36393639
| id:: rest->
36403640

36413641
letrfinfos=
3642-
ncenv.InfoReader.GetRecordOrClassFieldsOfType(None,ad,m,ty)
3643-
|> List.filter(fun fref-> IsRecdFieldAccessible ncenv.amap m ad fref.RecdFieldRef)
3644-
|> List.filter(fun fref-> fref.RecdField.IsStatic= statics)
3642+
ncenv.InfoReader.GetRecordOrClassFieldsOfType(None,ad,m,ty)
3643+
|> List.filter(fun fref-> fref.Name= id&& IsRecdFieldAccessible ncenv.amap m ad fref.RecdFieldRef&& fref.RecdField.IsStatic= statics)
36453644

36463645
letnestedTypes=
36473646
ty
36483647
|> GetNestedTypesOfType(ad, ncenv, Some id, TypeNameResolutionStaticArgsInfo.Indefinite,false, m)
36493648

36503649
// e.g. <val-id>.<recdfield-id>.<more>
3651-
(rfinfos|> List.filter(fun x-> x.Name= id)
3652-
|> List.collect(fun x-> x.FieldType|> ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m adfalse rest))@
3650+
(rfinfos|> List.collect(fun x-> x.FieldType|> ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m adfalse rest))@
36533651

36543652
// e.g. <val-id>.<property-id>.<more>
36553653
letFullTypeOfPinfo(pinfo:PropInfo)=
3656-
letrty= pinfo.GetPropertyType(amap,m)
3657-
letrty=if pinfo.IsIndexerthen mkRefTupledTy g(pinfo.GetParamTypes(amap, m))--> rtyelse rty
3658-
rty
3654+
letrty= pinfo.GetPropertyType(amap,m)
3655+
letrty=if pinfo.IsIndexerthen mkRefTupledTy g(pinfo.GetParamTypes(amap, m))--> rtyelse rty
3656+
rty
36593657

36603658
(ty
36613659
|> AllPropInfosOfTypeInScope ncenv.InfoReader nenv(Some id,ad) IgnoreOverrides m
3662-
|> List.filter(fun x-> x.IsStatic= statics)
3663-
|> List.filter(IsPropInfoAccessible g amap m ad)
3660+
|> List.filter(fun pinfo-> pinfo.IsStatic= statics&& IsPropInfoAccessible g amap m ad pinfo)
36643661
|> List.collect(fun pinfo->(FullTypeOfPinfo pinfo)|> ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m adfalse rest))@
36653662

36663663
// e.g. <val-id>.<event-id>.<more>
@@ -4294,16 +4291,14 @@ let rec ResolvePartialLongIdentInTypeForItem (ncenv: NameResolver) nenv m ad sta
42944291
| id:: rest->
42954292

42964293
letrfinfos=
4297-
ncenv.InfoReader.GetRecordOrClassFieldsOfType(None,ad,m,ty)
4298-
|> List.filter(fun fref-> IsRecdFieldAccessible ncenv.amap m ad fref.RecdFieldRef)
4299-
|> List.filter(fun fref-> fref.RecdField.IsStatic= statics)
4294+
ncenv.InfoReader.GetRecordOrClassFieldsOfType(None,ad,m,ty)
4295+
|> List.filter(fun fref-> fref.Name= id&& IsRecdFieldAccessible ncenv.amap m ad fref.RecdFieldRef&& fref.RecdField.IsStatic= statics)
43004296

43014297
letnestedTypes= ty|> GetNestedTypesOfType(ad, ncenv, Some id, TypeNameResolutionStaticArgsInfo.Indefinite,false, m)
43024298

43034299
// e.g. <val-id>.<recdfield-id>.<more>
43044300
for rfinfoin rfinfosdo
4305-
if rfinfo.Name= idthen
4306-
yield! ResolvePartialLongIdentInTypeForItem ncenv nenv m adfalse rest item rfinfo.FieldType
4301+
yield! ResolvePartialLongIdentInTypeForItem ncenv nenv m adfalse rest item rfinfo.FieldType
43074302

43084303
// e.g. <val-id>.<property-id>.<more>
43094304
letfullTypeOfPinfo(pinfo:PropInfo)=
@@ -4314,8 +4309,7 @@ let rec ResolvePartialLongIdentInTypeForItem (ncenv: NameResolver) nenv m ad sta
43144309
letpinfos=
43154310
ty
43164311
|> AllPropInfosOfTypeInScope ncenv.InfoReader nenv(Some id,ad) IgnoreOverrides m
4317-
|> List.filter(fun x-> x.IsStatic= statics)
4318-
|> List.filter(IsPropInfoAccessible g amap m ad)
4312+
|> List.filter(fun pinfo-> pinfo.IsStatic= statics&& IsPropInfoAccessible g amap m ad pinfo)
43194313

43204314
for pinfoin pinfosdo
43214315
yield!(fullTypeOfPinfo pinfo)|> ResolvePartialLongIdentInTypeForItem ncenv nenv m adfalse rest item

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp