Skip to content

Commit

Permalink
Merge pull request #31 from MichaelHochriegl/bugfix/abstract-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel authored Feb 6, 2022
2 parents d385b93 + b1404e3 commit 08664ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/CodeGenHelpers/MethodBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ internal override void Write(in CodeWriter writer)

foreach (var attribute in _attributes)
writer.AppendLine($"[{attribute}]");

if (IsAbstract)
{
writer.AppendLine($"{output};");
return;
}

using (writer.Block(output.Trim(), _generics.Contraints()))
{
_methodBodyWriter?.Invoke(writer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ namespace CodeGenHelpers.SampleCode
{
partial class SampleAbstractMethod
{
abstract void MyAbstractMethod()
{
}
abstract void MyAbstractMethod();
}
}

0 comments on commit 08664ae

Please # to comment.