FastScriptReload icon indicating copy to clipboard operation
FastScriptReload copied to clipboard

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

Open RunninglVlan opened this issue 1 year ago • 1 comments

Tried updating BouncerService.cs:

public interface IBouncerService {
  event Action<BouncerService.Case> Bounced;
  // ..
}

public class BouncerService : IBouncerService {
  public struct Case { /* .. */ }
  public event Action<Case> Bounced = delegate { };
  // ..
}

Got following SourceCodeCombined.cs:

public interface IBouncerService__Patched_{
  event Action<BouncerService.Case> Bounced;
  // ..
}

public class BouncerService__Patched_: IBouncerService {
  public struct Case { /* .. */ }
  public event Action<Case> 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<BouncerService.Case>'.

RunninglVlan avatar Nov 14 '24 12:11 RunninglVlan