• Kipper

    v0.12.1
  • Downloads

  • Docs

  • Playground

  • Changelog

  • Kipper

    v0.12.1
    • Downloads

    • Docs

    • Playground

    • Changelog

      • latest /
      • Kipper API /
      • Module /
      • @kipper/core /
      • compiler
    Kipper Docs
    • next
    • latest
    • 0.11.0
    • 0.10.4
    • 0.9.2
    • Overview

    • Quickstart

    • Goals for Kipper

    • Supported platforms

    • Usage Examples

      • Overview

      • Type Consistency

      • Runtime Type Casting

      • Strict Compiler Inspection

      • Integrated Runtime Library

    • Variables

      • Overview

      • String Type

      • Number Type

      • Boolean Type

      • Void Type

      • Null Type

      • Undefined Type

      • Array Type

      • Overview

      • Tangled Expression

      • Arithmetic Expression

      • Assignment Expression

      • Conditional Expressions

      • Logical Expressions

      • Bitwise Expression

      • Relational Expressions

      • Convert Or Cast Expression

      • F-String Expression

      • Member Access Expression

      • Function Call Expression

      • Lambda Expression

      • Matches Expression

      • Overview

      • Expression Statement

      • If Statement

      • While Loop

      • Do-While Loop

      • For Loop

      • Compound Statement

      • Jump Statement

    • Functions

    • Interfaces

    • Classes

    • Comments

    • Built-in Functions

      • Overview

      • Compiler Setup

        • Overview

          • index

          • compiler

          • errors

          • logger

          • utils

          • config

          • index

          • index

        • Overview

        • new

        • run

        • compile

        • help

        • version

      • latest /
      • Kipper API /
      • Module /
      • @kipper/core /
      • compiler
    • latest /
    • Kipper API /
    • Module /
    • @kipper/core /
    • compiler

    Edit page

    Class: GenericBuiltInType<T>

    compiler.GenericBuiltInType

    Represents a generic built-in type that is used in the type analysis phase.

    Since

    0.12.0

    Type parameters

    Name Type
    T extends GenericTypeArguments

    Hierarchy

    • BuiltInType

      ↳ GenericBuiltInType

      ↳↳ BuiltInTypeFunc

      ↳↳ BuiltInTypeArray

    Implements

    • GenericType<T>

    Table of contents

    Constructors

    • constructor

    Properties

    • _identifier
    • genericTypeArguments
    • interchangeableTypes

    Accessors

    • identifier
    • isCompilable
    • isGeneric
    • isUnion

    Methods

    • assertAssignableTo
    • changeGenericTypeArguments
    • getCompilableType
    • isAssignableTo
    • toString

    Constructors

    constructor

    • Protected new GenericBuiltInType<T>(identifier, genericTypeArguments)

    Type parameters

    Name Type
    T extends { identifier: string ; type: ProcessedType | ProcessedType[] }[]

    Parameters

    Name Type
    identifier KipperBuiltInTypeLiteral
    genericTypeArguments T

    Overrides

    BuiltInType.constructor

    Defined in

    kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts:18

    Properties

    _identifier

    • Protected Readonly _identifier: string

    Implementation of

    GenericType._identifier

    Inherited from

    BuiltInType._identifier

    Defined in

    kipper/core/src/compiler/semantics/types/base/type.ts:9


    genericTypeArguments

    • Readonly genericTypeArguments: T

    The generic type arguments for this type.

    Since

    0.12.0

    Implementation of

    GenericType.genericTypeArguments

    Defined in

    kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts:16


    interchangeableTypes

    ▪ Static Readonly interchangeableTypes: string[]

    Inherited from

    BuiltInType.interchangeableTypes

    Defined in

    kipper/core/src/compiler/semantics/types/base/built-in-type.ts:13

    Accessors

    identifier

    • get identifier(): string

    The identifier of this type.

    Returns

    string

    Implementation of

    GenericType.identifier

    Inherited from

    BuiltInType.identifier

    Defined in

    kipper/core/src/compiler/semantics/types/base/processed-type.ts:19


    isCompilable

    • get isCompilable(): boolean

    Returns whether the type is compilable.

    This is usually true for built-in types, but for generics it depends on the generic type arguments.

    Since

    0.11.0

    Returns

    boolean

    Implementation of

    GenericType.isCompilable

    Inherited from

    BuiltInType.isCompilable

    Defined in

    kipper/core/src/compiler/semantics/types/base/built-in-type.ts:25


    isGeneric

    • get isGeneric(): true

    Returns whether the type is a generic type.

    This is ALWAYS true, since this is a generic type.

    Since

    0.12.0

    Returns

    true

    Implementation of

    GenericType.isGeneric

    Overrides

    BuiltInType.isGeneric

    Defined in

    kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts:35


    isUnion

    • get isUnion(): boolean

    Returns whether the type is a union type.

    Since

    0.12.0

    Returns

    boolean

    Implementation of

    GenericType.isUnion

    Inherited from

    BuiltInType.isUnion

    Defined in

    kipper/core/src/compiler/semantics/types/base/processed-type.ts:46

    Methods

    assertAssignableTo

    ▸ Abstract assertAssignableTo(type, propertyName?, argumentName?): void

    Asserts that this type is assignable to another type.

    This will check for generic type arguments as well.

    Pasram

    type The type to check against.

    Throws

    AssignmentTypeError If the types are not assignable.

    Throws

    PropertyAssignmentTypeError If a property is not assignable.

    Throws

    ArgumentAssignmentTypeError If an argument is not assignable.

    Since

    0.12.0

    Parameters

    Name Type Description
    type ProcessedType -
    propertyName? string The name of the property that is being assigned. This is used for error messages.
    argumentName? string The name of the argument that is being assigned to. This is used for error messages.

    Returns

    void

    Implementation of

    GenericType.assertAssignableTo

    Overrides

    BuiltInType.assertAssignableTo

    Defined in

    kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts:54


    changeGenericTypeArguments

    ▸ Abstract changeGenericTypeArguments(genericTypeArguments): GenericType<T>

    Changes the generic type arguments for this generic type and returns a new generic type instance with the new arguments where the types have been adjusted.

    Since

    0.12.0

    Parameters

    Name Type Description
    genericTypeArguments T The new generic type arguments.

    Returns

    GenericType<T>

    Implementation of

    GenericType.changeGenericTypeArguments

    Defined in

    kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts:39


    getCompilableType

    ▸ getCompilableType(): CompilableType

    Gets the compilable type for this type.

    This function throws an error instead of returning undefined, since it's intended to be used in circumstances, where only due to a bug the type is not compilable. As such, it makes sense to strictly assert it will be compilable, unless an error occurs.

    Throws

    UndefinedType If the isCompilable is false, which should only occur if the identifier is of type UndefinedType.

    Since

    0.10.0

    Returns

    CompilableType

    Implementation of

    GenericType.getCompilableType

    Inherited from

    BuiltInType.getCompilableType

    Defined in

    kipper/core/src/compiler/semantics/types/base/processed-type.ts:60


    isAssignableTo

    ▸ isAssignableTo(type): boolean

    Returns whether this type is assignable to the given type. This discards any error messages.

    This simply returns whether the assertAssignableTo function throws an error or not.

    Since

    0.12.0

    Parameters

    Name Type Description
    type ProcessedType The type to check against.

    Returns

    boolean

    Implementation of

    GenericType.isAssignableTo

    Inherited from

    BuiltInType.isAssignableTo

    Defined in

    kipper/core/src/compiler/semantics/types/base/processed-type.ts:84


    toString

    ▸ toString(): string

    Returns the full string representation of this type.

    This also includes generic type arguments if this type is a generic type.

    Since

    0.12.0

    Returns

    string

    Implementation of

    GenericType.toString

    Inherited from

    BuiltInType.toString

    Defined in

    kipper/core/src/compiler/semantics/types/base/processed-type.ts:93

  • Developed at:

    • Releases
    • GitHub
    • Security
    • Issue Tracker
    • License
  • Copyright © 2021-2026 Luna Klatzer, 2024-2025 Lorenz Holzbauer & Fabian Baitura.
    Kipper is licensed under the GPL-3.0-or-later license.