• Kipper

    v0.12.1
  • Downloads

  • Docs

  • Playground

  • Changelog

  • Kipper

    v0.12.1
    • Downloads

    • Docs

    • Playground

    • Changelog

      • 0.11.0 /
      • 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

      • Compiler Setup

        • Overview

          • index

          • compiler

          • errors

          • logger

          • utils

          • config

          • index

          • index

        • Overview

        • new

        • run

        • compile

        • help

        • version

    • Variables

      • Overview

      • String Type

      • Number Type

      • Boolean Type

      • Void Type

      • Null Type

      • Undefined Type

      • Array Type

      • Overview

      • Arithmetic Expression

      • Assignment Expression

      • Conditional Expressions

      • Logical Expressions

      • Bitwise Expression

      • Relational Expressions

      • Convert Expression

      • F-String Expression

      • Member Access Expression

      • Function Call Expression

      • Overview

      • Expression Statement

      • If Statement

      • While Loop

      • Do-While Loop

      • For Loop

      • Compound Statement

      • Jump Statement

    • Functions

    • Comments

    • Built-in Functions

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

    Edit page

    Class: CheckedType

    compiler.CheckedType

    A wrapper class for a KipperType that is used to properly represent a type during type checking. This is primarily intended to check to handle invalid/undefined types and continue with type checking despite their existence.

    This type may be used for a compilation if the field isCompilable is true.

    Since

    0.10.0

    Hierarchy

    • Type

      ↳ CheckedType

    Table of contents

    Constructors

    • constructor

    Properties

    • _identifier
    • _isCompilable
    • _kipperType

    Accessors

    • identifier
    • isCompilable
    • kipperType

    Methods

    • getCompilableType
    • fromCompilableType
    • fromKipperType

    Constructors

    constructor

    • Private new CheckedType(identifier, kipperType)

    Parameters

    Name Type
    identifier string
    kipperType KipperType

    Overrides

    Type.constructor

    Defined in

    kipper/core/src/compiler/analysis/type.ts:74

    Properties

    _identifier

    • Protected Readonly _identifier: string

    Inherited from

    Type._identifier

    Defined in

    kipper/core/src/compiler/analysis/type.ts:27


    _isCompilable

    • Protected Readonly _isCompilable: boolean

    Defined in

    kipper/core/src/compiler/analysis/type.ts:72


    _kipperType

    • Protected Readonly _kipperType: KipperType

    Defined in

    kipper/core/src/compiler/analysis/type.ts:71

    Accessors

    identifier

    • get identifier(): string

    The identifier of this type.

    If kipperType is of type UndefinedCustomType, then this will return the invalid type identifier of UndefinedCustomType.

    Returns

    string

    Overrides

    Type.identifier

    Defined in

    kipper/core/src/compiler/analysis/type.ts:107


    isCompilable

    • get isCompilable(): boolean

    Returns whether the type is compilable.

    This function exists, since during type checking an undefined/invalid type may be encountered that should still be stored using this class though (but NOT compiled!).

    Since

    0.10.0

    Returns

    boolean

    Defined in

    kipper/core/src/compiler/analysis/type.ts:128


    kipperType

    • get kipperType(): KipperType

    The identifier in a KipperType format.

    This mainly differentiates from identifier by possibly returning the class UndefinedCustomType, which represents an invalid type that should still be stored though.

    Returns

    KipperType

    Defined in

    kipper/core/src/compiler/analysis/type.ts:117

    Methods

    getCompilableType

    ▸ getCompilableType(): KipperCompilableType

    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

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

    Since

    0.10.0

    Returns

    KipperCompilableType

    Defined in

    kipper/core/src/compiler/analysis/type.ts:142


    fromCompilableType

    ▸ Static fromCompilableType(kipperType): CheckedType

    Creates a new instance of this class using the given kipperType.

    This instance will ALWAYS be compilable, since the type KipperCompilableType automatically excludes any undefined/invalid types to be stored in this class.

    Parameters

    Name Type Description
    kipperType KipperCompilableType The type to use for the created of a checked type.

    Returns

    CheckedType

    Defined in

    kipper/core/src/compiler/analysis/type.ts:97


    fromKipperType

    ▸ Static fromKipperType(kipperType): CheckedType

    Creates a new CheckedType instance based on the passed KipperType.

    If the type is invalid, the function will still return a CheckedType, but the field isCompilable will be false and the instance WILL NOT be usable for a compilation.

    Parameters

    Name Type
    kipperType KipperType

    Returns

    CheckedType

    Defined in

    kipper/core/src/compiler/analysis/type.ts:86

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