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

Commitb6c307a

Browse files
forkiKevinRansom
authored andcommitted
Do we really need to keep resolving after we already found a type? (dotnet#5644)
* Do we really need to keep resolving after we already found a type?* Do we really need to keep resolving after we already found a type?* simplify check
1 parent8fbd6bf commitb6c307a

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

‎src/fsharp/NameResolution.fs‎

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3829,30 +3829,27 @@ let TryToResolveLongIdentAsType (ncenv: NameResolver) (nenv: NameResolutionEnv)
38293829
match List.tryLast plidwith
38303830
| Some id->
38313831
// Look for values called 'id' that accept the dot-notation
3832-
letty,isItemVal=
3833-
(match nenv.eUnqualifiedItems|> Map.tryFind idwith
3832+
letty=
3833+
match nenv.eUnqualifiedItems|> Map.tryFind idwith
38343834
// v.lookup : member of a value
3835-
| Some v->
3836-
match vwith
3837-
| Item.Value x->
3838-
letty= x.Type
3839-
letty=if x.BaseOrThisInfo= CtorThisVal&& isRefCellTy g tythen destRefCellTy g tyelse ty
3840-
Some ty,true
3841-
|_-> None,false
3842-
| None-> None,false)
3843-
3844-
if isItemValthen ty
3845-
else
3846-
(ty, LookupTypeNameInEnvNoArity OpenQualified id nenv)
3847-
||> List.fold(fun resTy tcref->
3848-
// type.lookup : lookup a static something in a type
3835+
| Some v->
3836+
match vwith
3837+
| Item.Value x->
3838+
letty= x.Type
3839+
letty=if x.BaseOrThisInfo= CtorThisVal&& isRefCellTy g tythen destRefCellTy g tyelse ty
3840+
Some ty
3841+
|_-> None
3842+
| None-> None
3843+
3844+
match tywith
3845+
| Some_-> ty
3846+
|_->
3847+
// type.lookup : lookup a static something in a type
3848+
LookupTypeNameInEnvNoArity OpenQualified id nenv
3849+
|> List.tryHead
3850+
|> Option.map(fun tcref->
38493851
lettcref= ResolveNestedTypeThroughAbbreviation ncenv tcref m
3850-
letty= FreshenTycon ncenv m tcref
3851-
letresTy=
3852-
match resTywith
3853-
| Some_-> resTy
3854-
| None-> Some ty
3855-
resTy)
3852+
FreshenTycon ncenv m tcref)
38563853
|_-> None
38573854

38583855
/// allowObsolete - specifies whether we should return obsolete types & modules

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp