ICxTypeQuery

Description

interface Tinman.Core.Cx.ICxTypeQuery

Extended by

CxDeclaration abstract
CxType abstract
CxTypeParameter sealed

Base interface for types, type declarations and type parameters that provides methods for performing type compatibility checks.

Given two types A and B, the following semantic is defined for type checking:

void Method<A,B>()
{
  A a = ...;
  B b = ...;

  // Compiles if A is assignable from B.
  // Compiles if B is assignable to A.
  a = b;

  // Compiles if A is assignable to B.
  // Compiles if B is assignable from A.
  b = a;

  // Compiles if A and B are the same.
  a = b;
  b = a;
}

Two types are thus the same if they are assignable to each other.

Public / Methods

Is​Assignable​From

3 overloads


[Pure]
public method IsAssignableFrom1 → (1)

type in : CxType

The other type or null.

returns → bool

true if type in may be assigned to this,
false if not or type in is null.

Is this type assignable from the given type in?

Given two types A and B, the following semantic is defined for this type check:

void Method<A,B>()
{
  A a = ...;
  B b = ...;

  // Compiles if A is assignable from B.
  a = b;

  // Compiles if B is assignable from A.
  b = a;
}

[Pure]
public method IsAssignableFrom2 → (1)

type in : CxDeclaration

The other type or null.

returns → bool

true if type in may be assigned to this,
false if not or type in is null.

Is this type assignable from the given type in?

Given two types A and B, the following semantic is defined for this type check:

void Method<A,B>()
{
  A a = ...;
  B b = ...;

  // Compiles if A is assignable from B.
  a = b;

  // Compiles if B is assignable from A.
  b = a;
}

[Pure]
public method IsAssignableFrom3 → (1)

type in : CxTypeParameter

The other type or null.

returns → bool

true if type in may be assigned to this,
false if not or type in is null.

Is this type assignable from the given type in?

Given two types A and B, the following semantic is defined for this type check:

void Method<A,B>()
{
  A a = ...;
  B b = ...;

  // Compiles if A is assignable from B.
  a = b;

  // Compiles if B is assignable from A.
  b = a;
}

Is​Assignable​To

3 overloads


[Pure]
public method IsAssignableTo1 → (1)

type in : CxType

The other type or null.

returns → bool

true if this may be assigned to type in,
false if not or type in is null.

Is this type assignable to the given type in?

Given two types A and B, the following semantic is defined for this type check:

void Method<A,B>()
{
  A a = ...;
  B b = ...;

  // Compiles if B is assignable to A.
  a = b;

  // Compiles if A is assignable to B.
  b = a;
}

[Pure]
public method IsAssignableTo2 → (1)

type in : CxDeclaration

The other type or null.

returns → bool

true if this may be assigned to type in,
false if not or type in is null.

Is this type assignable to the given type in?

Given two types A and B, the following semantic is defined for this type check:

void Method<A,B>()
{
  A a = ...;
  B b = ...;

  // Compiles if B is assignable to A.
  a = b;

  // Compiles if A is assignable to B.
  b = a;
}

[Pure]
public method IsAssignableTo3 → (1)

type in : CxTypeParameter

The other type or null.

returns → bool

true if this may be assigned to type in,
false if not or type in is null.

Is this type assignable to the given type in?

Given two types A and B, the following semantic is defined for this type check:

void Method<A,B>()
{
  A a = ...;
  B b = ...;

  // Compiles if B is assignable to A.
  a = b;

  // Compiles if A is assignable to B.
  b = a;
}

Is​Same​As

3 overloads


[Pure]
public method IsSameAs1 → (1)

type in : CxType

The other type or null.

returns → bool

true if the types are the same,
false if not or type in is null.

Checks if this type and the given type in are the same.

Given two types A and B, the following semantic is defined for this type check:

void Method<A,B>()
{
  A a = ...;
  B b = ...;

  // Compiles if A and B are the same.
  a = b;
  b = a;
}

[Pure]
public method IsSameAs2 → (1)

type in : CxDeclaration

The other type or null.

returns → bool

true if the types are the same,
false if not or type in is null.

Checks if this type and the given type in are the same.

Given two types A and B, the following semantic is defined for this type check:

void Method<A,B>()
{
  A a = ...;
  B b = ...;

  // Compiles if A and B are the same.
  a = b;
  b = a;
}

[Pure]
public method IsSameAs3 → (1)

type in : CxTypeParameter

The other type or null.

returns → bool

true if the types are the same,
false if not or type in is null.

Checks if this type and the given type in are the same.

Given two types A and B, the following semantic is defined for this type check:

void Method<A,B>()
{
  A a = ...;
  B b = ...;

  // Compiles if A and B are the same.
  a = b;
  b = a;
}