teal-language / tl

The compiler for Teal, a typed dialect of Lua
MIT License
2.15k stars 111 forks source link

Creation of userdata records should be disallowed #460

Closed Xandaros closed 2 years ago

Xandaros commented 3 years ago

This is currently legal:

local record Test
    userdata
    a: integer
    b: string
end

local test: Test = {a = 5, b = "a"}

I think this should not be possible - there should be no way of creating a userdata record - you can only be given one by native code.

hishamhm commented 2 years ago

Implemented by @pigpigyyy in #460!