Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Shared/Helpers/GeneratorUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public static EquatableList<string> GetTypeDeclarations(ITypeSymbol type)
{ IsRecord: true, IsValueType: true } => "record struct",
{ IsRecord: true, IsValueType: false } => "record",
{ IsRecord: false, IsValueType: true } => "struct",
{ IsRecord: false, IsValueType: false } => "class",
{ IsRecord: false, IsValueType: false, TypeKind: TypeKind.Class } => "class",
{ IsRecord: false, IsValueType: false, TypeKind: TypeKind.Interface } => "interface",
_ => string.Empty
};

Expand Down
8 changes: 8 additions & 0 deletions src/Tests/Examples/Issue536.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
public partial interface IInterface
{
[AutoCtor.AutoConstruct]
public partial class NestedClass
{
public IInterface Item { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//HintName: IInterface.NestedClass.g.cs
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by https://github.com/distantcam/AutoCtor
// </auto-generated>
//------------------------------------------------------------------------------

partial interface IInterface
{
partial class NestedClass
{
[global::System.Runtime.CompilerServices.CompilerGenerated]
[global::System.CodeDom.Compiler.GeneratedCode("AutoCtor", "0.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCode]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public NestedClass(global::IInterface item)
{
this.Item = item;
}
}
}