-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Improve diagnostic quality for less accessible base type argument #80483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
b0a0c7d
7e1ff18
26693a7
7619085
3f59cc1
1571964
c55b3cf
dd141d5
69c20ad
45c6fcc
16028bf
632be43
57e1b52
b3ce155
a738db0
5cd6798
2c73ea1
19e742e
4d586ee
0d26fd5
24b3a90
2020478
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -386,10 +386,20 @@ static bool containsOnlyOblivious(TypeSymbol type) | |
| diagnostics.Add(ErrorCode.ERR_StaticBaseClass, baseTypeLocation, baseType, this); | ||
| } | ||
|
|
||
| if (!this.IsNoMoreVisibleThan(baseType, ref useSiteInfo)) | ||
| var lessVisibleTypes = this.FindAllLessVisible(baseType, ref useSiteInfo); | ||
| foreach (var lessVisibleType in lessVisibleTypes) | ||
| { | ||
| // Inconsistent accessibility: base class '{1}' is less accessible than class '{0}' | ||
| diagnostics.Add(ErrorCode.ERR_BadVisBaseClass, baseTypeLocation, this, baseType); | ||
| if (Equals(baseType, lessVisibleType, TypeCompareKind.ConsiderEverything)) | ||
|
stbau04 marked this conversation as resolved.
Outdated
stbau04 marked this conversation as resolved.
Outdated
|
||
| { | ||
| // Inconsistent accessibility: base class '{1}' is less accessible than class '{0}' | ||
| diagnostics.Add(ErrorCode.ERR_BadVisBaseClass, baseTypeLocation, this, lessVisibleType); | ||
| } | ||
| else | ||
| { | ||
| // Inconsistent accessibility: type '{1}' is less accessible than class '{0}' | ||
| var lessVisibleTypeLocation = lessVisibleType.GetFirstLocation(); | ||
| diagnostics.Add(ErrorCode.ERR_BadVisBaseType, baseTypeLocation, this, lessVisibleType); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you intend to use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. iirc |
||
| } | ||
| } | ||
|
|
||
| if (baseType.HasFileLocalTypes() && !this.HasFileLocalTypes()) | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.