luau
luau copied to clipboard
[New solver] Blocked type trying to implement linked lists
type node<T> = {
value: T,
_next: node<T>?
}
type llist<T> = {
_head: node<T>?
}
local ll = {} :: llist<string>
local cur = ll._head
while cur do
print(cur.value) -- line 33
cur = cur._next -- line 34
end
on cur.value:
Type Error: (33,8) Key 'value' is missing from '(buffer | class | function | number | string | table | thread | true) & *blocked-133627*' in the type '((buffer | class | function | number | string | table | thread | true) & *blocked-133627*) | node
'
on cur._next:
Type Error: (34,8) Key '_next' is missing from '(buffer | class | function | number | string | table | thread | true) & *blocked-133627*' in the type '((buffer | class | function | number | string | table | thread | true) & *blocked-133627*) | node
'