• 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

    Interface: CompilableType

    compiler.CompilableType

    Represents a type that can be compiled i.e. a type that exists and type checks can be done on it.

    Since

    0.11.0

    Hierarchy

    • ProcessedType

      ↳ CompilableType

    Implemented by

    • BuiltInTypeAny
    • BuiltInTypeBool
    • BuiltInTypeNull
    • BuiltInTypeNum
    • BuiltInTypeObj
    • BuiltInTypeStr
    • BuiltInTypeType
    • BuiltInTypeUndefined
    • BuiltInTypeVoid

    Table of contents

    Properties

    • _identifier
    • identifier
    • isCompilable

    Accessors

    • isGeneric
    • isUnion

    Methods

    • assertAssignableTo
    • getCompilableType
    • isAssignableTo
    • toString

    Properties

    _identifier

    • Protected Readonly _identifier: string

    Inherited from

    ProcessedType._identifier

    Defined in

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


    identifier

    • Readonly identifier: string

    The identifier of this type.

    Since

    0.11.0

    Overrides

    ProcessedType.identifier

    Defined in

    kipper/core/src/compiler/semantics/types/base/compilable-type.ts:12


    isCompilable

    • Readonly isCompilable: true

    Returns whether the type is compilable. Is always true for this type.

    This only exists to differentiate this type from the base ProcessedType.

    Since

    0.11.0

    Overrides

    ProcessedType.isCompilable

    Defined in

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

    Accessors

    isGeneric

    • get isGeneric(): boolean

    Returns whether the type is a generic type.

    This is false unless overridden by a subclass.

    Since

    0.12.0

    Returns

    boolean

    Inherited from

    ProcessedType.isGeneric

    Defined in

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


    isUnion

    • get isUnion(): boolean

    Returns whether the type is a union type.

    Since

    0.12.0

    Returns

    boolean

    Inherited from

    ProcessedType.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 the given type.

    Throws

    TypeError If the types are not assignable.

    Since

    0.12.0

    Parameters

    Name Type Description
    type ProcessedType The type to check against.
    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

    Inherited from

    ProcessedType.assertAssignableTo

    Defined in

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


    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

    Inherited from

    ProcessedType.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

    Inherited from

    ProcessedType.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

    Inherited from

    ProcessedType.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.