提交 36420eaa 编写于 作者: S Sam Harwell

Avoid a newline after type parameter attributes

Fixes #38916
上级 1ca226ee
......@@ -553,8 +553,7 @@ internal class MyAttribute : System.Attribute { }
// {CodeAnalysisResources.InMemoryAssembly}
#endregion
public class [|C|]<[MyAttribute]
T>
public class [|C|]<[MyAttribute] T>
{{
public C();
......@@ -593,8 +592,7 @@ internal class AllowNullAttribute : System.Attribute { }
using System.Runtime.CompilerServices;
[NullableContextAttribute(1)]
public interface [|C|]<[NullableAttribute(2)]
T>
public interface [|C|]<[NullableAttribute(2)] T>
{{
bool Equals([AllowNullAttribute] T other);
}}");
......@@ -2273,8 +2271,7 @@ void M()
using System.Runtime.CompilerServices;
public class [|TestType|]<[NullableAttribute(1)]
T> where T : notnull
public class [|TestType|]<[NullableAttribute(1)] T> where T : notnull
{{
public TestType();
}}";
......@@ -2355,8 +2352,7 @@ void M([|D|]&lt;int&gt; lambda)
using System.Runtime.CompilerServices;
public delegate void [|D|]<[NullableAttribute(1)]
T>() where T : notnull;";
public delegate void [|D|]<[NullableAttribute(1)] T>() where T : notnull;";
using var context = TestContext.Create(
LanguageNames.CSharp,
......
......@@ -290,7 +290,8 @@ private int LineBreaksAfter(SyntaxToken previousToken, SyntaxToken currentToken)
}
}
if (previousToken.GetAncestor<ParameterSyntax>() == null)
if (previousToken.GetAncestor<ParameterSyntax>() == null
&& previousToken.GetAncestor<TypeParameterSyntax>() == null)
{
return 1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册