镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Fix handling of not found exported types - #50845

Merged
MichalStrehovsky merged 1 commit into
mainfrom
MichalStrehovsky-patch-1
Apr 8, 2021
Merged

MichalStrehovsky merged 1 commit into
mainfrom
MichalStrehovsky-patch-1

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

This was missed in #50437.

Wonder if we should have just introduced a new overload of GetType that returns object. This "return resolution failure that we then need to not forget to check" looks like a potential bug farm.

public MetadataType GetType(string nameSpace, string name, bool throwIfNotFound = true)
{
    /* the obvious implementation that calls the virtual method */
}

public abstract object GetType(string nameSpace, string name, NotFoundBehavior notFoundBehavior)

This was missed in #50437.

Wonder if we should have just introduced a new overload of GetType that returns `object`. This "return resolution failure that we then need to not forget to check" looks like a potential bug farm.

```csharp
public MetadataType GetType(string nameSpace, string name, bool throwIfNotFound = true)
{
    /* the obvious implementation that calls the virtual method */
}

public abstract object GetType(string nameSpace, string name, NotFoundBehavior notFoundBehavior)
```

@adamsitnik adamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

Looks like David is out - @dotnet/crossgen-contrib could someone have a look?

@trylek trylek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The proximate fix looks good to me. I defer to David to comment on the broader design considerations you posited.

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

I defer to David to comment on the broader design considerations you posited.

I'll make sure to ask that question again when this landmine explodes :)

@MichalStrehovsky
MichalStrehovsky merged commit ae820d0 into main Apr 8, 2021
@MichalStrehovsky
MichalStrehovsky deleted the MichalStrehovsky-patch-1 branch April 8, 2021 07:13
@ghost ghost locked as resolved and limited conversation to collaborators May 8, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants