Skip to content

Commit

Permalink
Reproduce type attribute problem
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmarbach committed Jun 30, 2019
1 parent dbfb512 commit a548b85
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/PublicApiGeneratorTests/Class_generics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ public class ClassWithGenericType<T>
}");
}

[Fact]
public void Should_output_generic_type_parameter_attribute()
{
AssertPublicApi(typeof(ClassWithGenericTypeAttribute<>),
@"namespace PublicApiGeneratorTests.Examples
{
public class ClassWithGenericTypeAttribute<[PublicApiGeneratorTests.Examples.MyTypeAttribute()] T>
{
public ClassWithGenericTypeAttribute() { }
}
}");
}

[Fact]
public void Should_output_multiple_generic_type_parameters()
{
Expand Down Expand Up @@ -141,6 +154,15 @@ public class ClassWithGenericType<T>
{
}

public class ClassWithGenericTypeAttribute<[MyType]T>
{
}

[AttributeUsage(AttributeTargets.GenericParameter)]
public sealed class MyTypeAttribute : Attribute
{
}

public class ClassWithMultipleGenericTypes<T1, T2>
{
}
Expand Down

0 comments on commit a548b85

Please sign in to comment.