Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler hangs when cgenerator.lua errors #260

Open
distantforest1 opened this issue May 30, 2024 · 1 comment
Open

Compiler hangs when cgenerator.lua errors #260

distantforest1 opened this issue May 30, 2024 · 1 comment
Labels

Comments

@distantforest1
Copy link

Bug description

The compiler hangs when running the following example:

local RTest = @record {}

function RTest:run(a: auto) -- remove: `a: auto` to see the actual error
  ## if a.type.is_niltype then
    local a = 0
  ## end
  local x: sequence(integer)
  local y

  return x, y
end

local r: RTest
r:run()

Expected behavior

Error saying any type not supported yet or something to that effect. Currently it freezes, was tough to track down since I was working on a lot of code at once (porting code from lua).

Workaround

Explicitly putting the in the type.

Environment

Provide relevant information about your environment:
Nelua 0.2.0-dev
Build number: 1615
Git date: 2024-04-20 09:45:08 -0300
Git hash: 9f75e00
Semantic version: 0.2.0-dev.1615+9f75e009
Copyright (C) 2019-2024 Eduardo Bart (https://nelua.io/)

Windows 10 x64

@edubart
Copy link
Owner

edubart commented Sep 22, 2024

Indeed this is a bug, a shorter example is:

local function f(a: auto) local b return b end
f()

I know the cause, but not fixing soon, it's tricky, might be fixed when the language improves support for any and table types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants