union

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package union provides union type analysis operations.

These operations extract and merge information from union types, commonly used in contextual typing and function signature merging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DistributeExpected

func DistributeExpected(expected typ.Type) []typ.Type

DistributeExpected distributes an expected return type over union members.

func FieldTypes

func FieldTypes(expected typ.Type, fieldName string) typ.Type

FieldTypes collects field types from all union members that have the field.

func FunctionTypes

func FunctionTypes(expected typ.Type) []*typ.Function

FunctionTypes extracts function types from a union for contextual typing.

func MergeFunctions

func MergeFunctions(fns []*typ.Function) *typ.Function

MergeFunctions creates a merged function signature from multiple functions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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