final class · System.Reflection

ParameterInfo

public final class ParameterInfo

A parameter of a method or constructor.

Kind
final class
Namespace
System.Reflection
Assembly
System.Core
Access
public, final
Source file
Reflection.ant

Inheritance

Base classes
Any ParameterInfo

Properties

str Name { get; }
#

read-only

Type ParameterType { get; }
#

read-only

i32 Position { get; }
#

read-only

Methods

GetCustomAttributes() : any[]
#

The custom attributes written on the parameter ([Tag("n")] i32 n).

GetCustomAttributes(Type attributeType) : any[]
#
IsDefined(Type attributeType) : bool
#
override ToString() : str
#

override

Private and internal members (5)

readonly str name
#

private

readonly Type type
#

private

readonly i32 position
#

private

MethodBase? member
#

internal

The method or constructor it belongs to (set when that is made).

new(str name, Type type, i32 position)
#

internal

Inherited members (4)

Source

ParameterInfo as Antril, decompiled from its Larva HIR.

System.Reflection.ParameterInfo.ant
// System.Reflection.ParameterInfo — System.Core (decompiled from Larva HIR)

import System;

into namespace System.Reflection
{
	/// A parameter of a method or constructor.
	public final class ParameterInfo
	{
		readonly str name;
		readonly Type type;
		readonly i32 position;

		internal:
			/// The method or constructor it belongs to (set when that is made).
			MethodBase? member;

			new(str name, Type type, i32 position)
			{
				this.name = name;
				this.type = type;
				this.position = position;
			}

		public:
			/// The custom attributes written on the parameter (`[Tag("n")] i32 n`).
			GetCustomAttributes() : any[]
			{
				if (member is MethodBase owner)
					return owner.Describer.Attributes(4000000 + owner.Index * 256 + position);
				return [];
			}

			GetCustomAttributes(Type attributeType) : any[] => Attributes.Of(GetCustomAttributes(), attributeType);

			IsDefined(Type attributeType) : bool => GetCustomAttributes(attributeType).Length > 0;

			override ToString() : str => type.FullName + " " + name;

			str Name
			{
				get => name;
			}

			Type ParameterType
			{
				get => type;
			}

			i32 Position
			{
				get => position;
			}
	}
}
Esc