Comments (2)
from roslyn.
Looks like this is caused by different nullability contexts (generated files have different nullability context that's why you couldn't repro without source generators probably). Can reproduce with something as simple as:
#nullable enable
partial class C
#nullable disable
: IInterface<C>
#nullable enable
{
}
partial class C : IInterface<C>
{
public static void M() { }
}
interface IInterface<T>
{
static abstract void M();
}
See SharpLab.
Results in this IL (notice the duplicate .override method
):
.class private auto ansi beforefieldinit C
extends [System.Runtime]System.Object
implements class IInterface`1<class C>
{
// Methods
.method public hidebysig static
void M () cil managed
{
.override method void class IInterface`1<class C>::M()
.override method void class IInterface`1<class C>::M()
// Method begins at RVA 0x2050
// Code size 1 (0x1)
.maxstack 8
IL_0000: ret
} // end of method C::M
Similar issue I've stumbled upon recently in razor: #40538 (via dotnet/razor#9837).
from roslyn.
Related Issues (20)
- Automatic line wrapping, taking into account the specified formatting and language syntax.
- Run code clean up -- Can you remove redundant blank lines like CShapier? HOT 1
- Cannot define a raw string literal ending in double-quote HOT 1
- Move more logic from the Controller.Session down to the SignatureHelpService
- Assigning members of ICollection types with collection initializers can provably cause NullReferenceExceptions HOT 4
- StaticAbstractMembersInInterfaces - Roslyn does not warn that a most-derived static interface method implementation will not be used HOT 8
- Scripting API - Operation is not supported on this platform. (when AOT published)
- A potential bug in custom string interpolation constructor resolving for `ref` parameters
- Compile Error After Upgrading - SDK 8.0.300 - 'Class1' does not contain a definition for 'DisposeAsync' HOT 3
- Allow manually forcing a refresh of the IntelliSense database HOT 2
- Allow manually forcing a refresh of the IntelliSense database HOT 1
- "Use primary constructor" does not produce a diagnostic for an empty public parameterless constructor HOT 6
- Invalid implicit conversion from long to int HOT 6
- SymbolFinder.FindReferencesAsync not returning references used as base constructor
- SymbolFinder.FindReferencesAsync not returning references used as base constructor HOT 1
- Question: MSBuildWorkspace can't open .proj file
- Compiler should allow calling a property's setter if it doesn't affect the structure itself HOT 2
- Debug Assert error for __arglist (not handled in ref safety analysis)
- `value` parameter considered in scope in `nameof()` in event accessor attribute
- Having two embedded resources dependent on the same file causes CS1508 error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from roslyn.