handzlikchris / handzlikchris/FastScriptReload

Interface implementation returning inner class isn't correctly patched

Offen
#162 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C#
Sterne
2.2k
Forks
167
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Interface and class in the same file. Method returns inner class.
```csharp
public interface ITest {
Test.Builder Create(Entity entity, string prefixId);
}

public class Test : ITest {
Builder ITest.Create(Entity entity, string prefixId) {
// ...
return new Builder();
}

public class Builder { }
}
```
FSR produces:
```csharp
public interface ITest__Patched_{
Test.Builder Create(Entity entity, string prefixId);
}

public class Test__Patched_: ITest { // error CS0535
Builder ITest.Create(Entity entity, string prefixId) { // error CS0539
// ...
return new Builder();
}

public class Builder { }
}
```
error CS0535: 'Test__Patched_' does not implement interface member 'ITest.Create(Entity, string)'
error CS0539: 'Test__Patched_.Create(Entity, string)' in explicit interface declaration is not found among members of the interface that can be implemented

Moving interface out of the file doesn't help. Same CS0539 and CS0535 errors.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start by reproducing the shown C# example with an interface and an inner class whose method returns that inner class. Trace the patching of the interface and implementing class, then verify that the generated code compiles without CS0535 or CS0539, both when the interface is in the same file and when it is moved.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
devtools, game-dev
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.