Skip to content

Type.FullName behavior diverges from documentation #12104

@Youssef1313

Description

@Youssef1313

Description

https://learn.microsoft.com/en-us/dotnet/api/system.type.fullname?view=net-10.0

null if the current instance represents a generic type parameter, an array type, pointer type

using System;

var m = typeof(C).GetMethod("M")!;
foreach (var p in m.GetParameters())
{
    Console.WriteLine($"{p.Name}: {p.ParameterType.FullName}");
}

public class C
{
    public unsafe void M<T>(int* x, int[] y, T z) { }
}

This prints:

x: System.Int32*
y: System.Int32[]
z:

So it doesn't seem to be null for points and array types?

Reproduction Steps

See above.

Expected behavior

Implementation and docs are aligned.

Actual behavior

They are not aligned.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions