Skip to content

attempting to modify bounds of a potentially visited generic #2061

@ratplier

Description

@ratplier

no clue on the minimal repro so here is all my code

--!strict
type actions<T=unknown, A...=...unknown> = { [string]: (state: T, A...) -> (T) }
type disconnect = () -> ()

type producer<state, actions = actions> = {
	get:
		& (() -> state)
		& (<T>(selector: (state) -> T) -> T),
	set: (new_state: state) -> (),
	reset: () -> (),
	
	subscribe:
		& (<T>(listener: (state: state, last_state: state) -> ()) -> disconnect)
		& (<T>(selector: (state) -> T?, listener: (value: T, last_value: T) -> ()) -> disconnect),
	
	once:
		& (<T>(listener: (state: state, last_state: state) -> ()) -> disconnect)
		& (<T>(selector: (state) -> T?, listener: (value: T, last_value: T) -> ()) -> disconnect),
} & actions

type interface = {
	create: <state>(default: state) -> <actions>(actions: actions) -> producer<state, actions>,
	clone: <state>(producer: producer<state>) -> producer<state>,
}

local a: interface
local default: {
	todos: { string },
	dates: { number },
}

a.create(| -- instant crash

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingnew solverThis issue is specific to the new solver.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions