mirror of
https://github.com/godotengine/godot.git
synced 2024-10-22 21:21:53 +00:00
Merge pull request #98059 from zaevi/fix_csharp_unhandled_GD0303
[.NET] Fix unhandled GD0303 error for nested generic attribute types
This commit is contained in:
commit
c409546cc3
|
@ -395,6 +395,11 @@ public class MustBeVariantAnnotatedMethods
|
||||||
public void MethodWithWrongAttribute()
|
public void MethodWithWrongAttribute()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[NestedGenericTypeAttributeContainer.NestedGenericTypeAttribute<bool>()]
|
||||||
|
public void MethodWithNestedAttribute()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GenericTypeAttribute<bool>()]
|
[GenericTypeAttribute<bool>()]
|
||||||
|
@ -657,3 +662,11 @@ public class ClassNonVariantAnnotated
|
||||||
public class GenericTypeAttribute<[MustBeVariant] T> : Attribute
|
public class GenericTypeAttribute<[MustBeVariant] T> : Attribute
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class NestedGenericTypeAttributeContainer
|
||||||
|
{
|
||||||
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
|
||||||
|
public class NestedGenericTypeAttribute<[MustBeVariant] T> : Attribute
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ namespace Godot.SourceGenerators
|
||||||
{
|
{
|
||||||
ITypeParameterSymbol? typeParamSymbol = parentSymbol switch
|
ITypeParameterSymbol? typeParamSymbol = parentSymbol switch
|
||||||
{
|
{
|
||||||
IMethodSymbol methodSymbol when parentSyntax.Parent is AttributeSyntax &&
|
IMethodSymbol methodSymbol when parentSyntax.Ancestors().Any(s => s is AttributeSyntax) &&
|
||||||
methodSymbol.ContainingType.TypeParameters.Length > 0
|
methodSymbol.ContainingType.TypeParameters.Length > 0
|
||||||
=> methodSymbol.ContainingType.TypeParameters[typeArgumentIndex],
|
=> methodSymbol.ContainingType.TypeParameters[typeArgumentIndex],
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user