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 ¶
- func IsReservedPath(packagePath string) bool
- func LookupReceiverMethod(receiver types.Type, name string) (*Package, Symbol, bool)
- func LookupRuntimeExport(name string) (*Package, RuntimeExport, bool)
- func ReceiverMatches(pattern, actual types.Type, typeParameterNames []string) bool
- type Block
- type JSXProvider
- type Kind
- type Package
- type Parameter
- type RuntimeExport
- type Symbol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsReservedPath ¶
func LookupReceiverMethod ¶
func LookupRuntimeExport ¶ added in v0.1.9
func LookupRuntimeExport(name string) (*Package, RuntimeExport, bool)
LookupRuntimeExport returns the compiler-owned package that declares name. Inferred library result types may use these declarations internally, while source annotations still require an explicit import.
func ReceiverMatches ¶ added in v0.2.3
ReceiverMatches reports whether a compiler-known receiver pattern applies to a checked value type. Official packages use the same matching rule as the portable standard library, while remaining unavailable until explicitly imported.
Types ¶
type Block ¶ added in v0.2.9
Block describes the callback accepted by a compiler-owned package function. It deliberately models only ordinary callback blocks; structured control-flow blocks remain declaration-provider functionality.
type JSXProvider ¶ added in v0.2.3
JSXProvider declares the node and intrinsic-attribute types contributed by an explicitly imported package. Grammar remains shared while each frontend runtime owns its JSX semantics.
type Package ¶
type Package struct {
Path string
ModulePath string
RuntimeAlias string
RuntimeExports []RuntimeExport
Source string
Kind Kind
Internal bool
Targets map[string]bool
NativeSyntax bool
TypeProvider string
JSX *JSXProvider
Symbols map[string]Symbol
}
func PublicPortablePackages ¶ added in v0.3.26
PublicPortablePackages returns public compiler-owned packages that authored source may import in the selected backend mode.
func RuntimeDependenciesForType ¶ added in v0.1.5
RuntimeDependenciesForType returns compiler-owned modules whose runtime declarations are named by a library intrinsic's result type. Source code still needs an explicit import to refer to those declarations directly.
func RuntimeExportPackages ¶ added in v0.2.3
RuntimeExportPackages returns public portable packages that declare source- visible runtime types. Interactive tooling uses this catalog without exposing internal packages or target-specific APIs.
func (*Package) DefaultAlias ¶
type RuntimeExport ¶ added in v0.1.5
type Symbol ¶
type Symbol struct {
Name string
Intrinsic string
// CompilerOnly keeps runner protocol operations out of user imports and
// language-service completion while allowing compiler-owned source to use
// the same checked package boundary.
CompilerOnly bool
// RuntimeIndependent marks an intrinsic that is fully lowered by every
// backend even when its public package also provides a source wrapper.
RuntimeIndependent bool
RequiredSymbols []string
TypeParameters []string
EqualityTypes []types.Type
OrderingTypes []types.Type
Receiver types.Type
ReceiverMutable bool
Parameters []Parameter
Return types.Type
Variadic bool
Inference string
RuntimeDependencies []types.Type
Block *Block
}
func Instantiate ¶
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 ReceiverMethods ¶ added in v0.1.6
ReceiverMethods returns the portable receiver methods available for a checked type. Language tooling uses the same contracts as the checker so completion cannot advertise target-native or otherwise invalid members.