Documentation
¶
Overview ¶
Package declaration defines compiler-owned type information supplied by runtime-library providers. It is deliberately independent of syntax ASTs: RBS, .d.ts, Go export data, and dynamic framework indexers can all target the same representation without making application authors maintain shadow declaration files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶ added in v0.2.0
type Block struct {
Parameters []types.Type
// ControlBoundary prevents return, break, and next from crossing a
// backend callback whose target-language ownership would otherwise differ.
// Nested functions and loops still own their local control transfers.
ControlBoundary bool
// Return makes the block value-producing. The final expression must be
// assignable to this type.
Return types.Type
// ResultBoundary makes prefix try abort this structured operation with its
// declared Result error. A value-producing block uses Return as the success
// type; a structured iteration uses the enclosing member's Result success.
// It is not an authored block parameter. Authored return is rejected until
// lexical transfer and resource cleanup share one portable contract; use try
// to abort this boundary with Err.
ResultBoundary types.Type
// Structured keeps the block in typed IR instead of lowering it to a
// backend callback. Structured blocks may be assigned or returned while
// preserving return, break, and next in their lexical owner.
Structured bool
}
type Catalog ¶
type Catalog struct {
Types map[string]*Type
Modules map[string]*Module
FunctionBlockRules []FunctionBlockRule
FunctionArgumentReferenceRules []FunctionArgumentReferenceRule
// RuntimeTypesByModule names compiler-owned value representations required
// by generated declarations in a particular application module.
RuntimeTypesByModule map[string][]types.Type
}
func NewCatalog ¶
func NewCatalog() *Catalog
type DeclarationReference ¶ added in v0.2.28
DeclarationReference identifies a project declaration that a provider makes visible only in one declarative call position. It does not create a source import or make the declaration generally visible in the module.
type FunctionArgumentReferenceRule ¶ added in v0.2.28
type FunctionArgumentReferenceRule struct {
Package string
Function string
Argument int
Owner DeclarationReference
Targets []DeclarationReference
}
FunctionArgumentReferenceRule describes a positional argument whose values are compiler-resolved project declarations. Language tooling uses the same provider metadata as the compiler instead of hard-coding individual DSLs.
type FunctionBlockRule ¶ added in v0.2.0
type FunctionBlockRule struct {
Package string
Function string
EnclosingSuperclass string
TypeArgument int
ParameterTypeSuffix string
}
FunctionBlockRule describes a package function whose block type is derived from one of the call arguments. Providers use this for declarative DSLs without teaching the checker package-specific syntax.
type MemberKind ¶
type MemberKind string
const ( Method MemberKind = "method" Property MemberKind = "property" )
type Type ¶
type Type struct {
Name string
TypeParameters []string
Superclass string
// SourceModule identifies a provider declaration backed by a project
// source type. Outside that module, ordinary source references still need
// an explicit import even though provider members remain available after
// the type flows through another declaration.
SourceModule string
InstanceMembers map[string]Member
ClassMembers map[string]Member
}