handzlikchris / handzlikchris/FastScriptReload

Error on updating file with interface+class with event parameter that's inside class

Open
#148 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2.2k
Forks
167
PR merge metrics
No merged PRs in 30d

Description

Tried updating BouncerService.cs:
```csharp
public interface IBouncerService {
event Action Bounced;
// ..
}

public class BouncerService : IBouncerService {
public struct Case { /* .. */ }
public event Action Bounced = delegate { };
// ..
}
```
Got following SourceCodeCombined.cs:
```csharp
public interface IBouncerService__Patched_{
event Action Bounced;
// ..
}

public class BouncerService__Patched_: IBouncerService {
public struct Case { /* .. */ }
public event Action Bounced = delegate { };
// ..
}
```
With following error:
```
error CS0738: 'BouncerService__Patched_' does not implement interface member 'IBouncerService.Bounced'. 'BouncerService__Patched_.Bounced' cannot implement 'IBouncerService.Bounced' because it does not have the matching return type of 'Action'.
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the BouncerService.cs example and inspect the generated SourceCodeCombined.cs output, focusing on how the interface and class are renamed. Reproduce the compiler error and trace the hot-reload transformation that produces the renamed types. Done means the transformed example compiles without CS0738 and the event still matches the interface member.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
devtools, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.