Skip to content

Conversation

@KevinRansom
Copy link
Contributor

@KevinRansom KevinRansom commented May 21, 2018

image

@KevinRansom KevinRansom requested a review from dsyme May 21, 2018 05:05
match x with
| ILMeth(_,ilminfo,_) -> ilminfo.ApparentEnclosingAppType
| _ -> x.ApparentEnclosingType
helpEnsureTypeHasMetadata x.TcGlobals x.ApparentEnclosingType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to this change, but was exactly does "help ensure" mean? Can you please rename it to just "ensure"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@forki It doesn't guarantee to convert to a type with metadata, but for function and tuple types it does. So it's something like convertToTypeWithMetadataIfPossible.

| ILMeth(_,ilmeth,_) -> ilmeth.FormalMethodTypars
| FSMeth(g,typ,vref,_) ->
| FSMeth(g,_,vref,_) ->
let typ = x.ApparentEnclosingAppType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, yes. However there are a few other paths to AnalyzeTypeOfMemberVal, which is assuming that typ is an AppTy, e.g. via GetCompiledReturnTy and GetParamTypes which I think will also fail. I'm surprised we're not hitting those

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dsyme, yes I was going to look through those today. The trick is figuring out the repro, as you say, with all this code base none hit it.

@forki
Copy link
Contributor

forki commented May 21, 2018 via email

@KevinRansom
Copy link
Contributor Author

@dsyme, can you take a look at the update changes, I think I have the right paths covered now. Although, I couldn't write any failing repros.

@dsyme
Copy link
Contributor

dsyme commented May 21, 2018

That looks good.

@KevinRansom KevinRansom merged commit 4eed66b into dotnet:master May 21, 2018
@KevinRansom KevinRansom deleted the fix4957 branch May 31, 2018 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants