stdlib

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package stdlib describes compiler-known portable and platform packages. Definitions are semantic contracts; backends lower their intrinsic IDs to target APIs without leaking those APIs into the TypeRB source language.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsReservedPath

func IsReservedPath(packagePath string) bool

func LookupReceiverMethod

func LookupReceiverMethod(receiver types.Type, name string) (*Package, Symbol, bool)

Types

type Kind

type Kind string
const (
	Portable Kind = "portable"
	Platform Kind = "platform"
)

type Package

type Package struct {
	Path         string
	ModulePath   string
	RuntimeAlias string
	Source       string
	Kind         Kind
	Internal     bool
	Targets      map[string]bool
	NativeSyntax bool
	TypeProvider string
	Symbols      map[string]Symbol
}

func Lookup

func Lookup(packagePath string) (*Package, bool)

func (*Package) DefaultAlias

func (p *Package) DefaultAlias() string

func (*Package) Supports

func (p *Package) Supports(mode string) bool

type Parameter

type Parameter struct {
	Name     string
	Type     types.Type
	Optional bool
	Mutable  bool
}

type Symbol

type Symbol struct {
	Name            string
	Intrinsic       string
	TypeParameters  []string
	Receiver        types.Type
	ReceiverMutable bool
	Parameters      []Parameter
	Return          types.Type
	Variadic        bool
	Inference       string
}

func Instantiate

func Instantiate(symbol Symbol, arguments []types.Type) Symbol

Instantiate substitutes compiler-owned type parameters inferred from call arguments. The first occurrence fixes a type variable; later occurrences are checked against that substitution by the ordinary checker.

func (Symbol) HasReceiver

func (s Symbol) HasReceiver() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL