tl icon indicating copy to clipboard operation
tl copied to clipboard

[next branch] `where` conflicts with `<total>`

Open Andre-LA opened this issue 8 months ago • 3 comments

Code to reproduce:

local interface Op
	op: string
end

local interface Binary
	is Op
	left: number
	right: number
end

local record Add
	is Binary
	-- where self.op == '+' -- removing the comment triggers an error
end

local sum <total>: Add = {
	op = '+',
	left = 10,
	right = 20
}

print(sum.op, sum.left, sum.right)

Andre-LA avatar Jun 07 '24 18:06 Andre-LA