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

Native Code Generation Failure: internal lowering failure #1605

Closed
Meifeng1510 opened this issue Jan 6, 2025 · 1 comment · Fixed by #1612
Closed

Native Code Generation Failure: internal lowering failure #1605

Meifeng1510 opened this issue Jan 6, 2025 · 1 comment · Fixed by #1612
Assignees
Labels
bug Something isn't working

Comments

@Meifeng1510
Copy link

I encountered an error while trying to compile a script. The error message indicates a native code generation internal lowering failure

Native code generation of script =ServerScriptService.lowering failure failed:  
Native code generation failed to compile some of the module functions:
Function '(anonymous)' at line 1 encountered an internal lowering failure.
Script will be interpreted.

The script causing the issue is as follows:

--!native

local TRUE_CONST = true
TRUE_CONST = TRUE_CONST

local tbl = {}
for i = 1, 1 do i=i end

local function func() return TRUE_CONST end

function tbl.Unary() end
function tbl.Add() end
function tbl.Subtract() end
function tbl.Multiply() end
function tbl.Divide() end
function tbl.Power() end
function tbl.Modulo() end
function tbl.LessThan() end
function tbl.EqualTo() end
function tbl.LessThanOrEqualTo() end
function tbl.GetDigitsCount() end

tbl.Concatenate = tbl.something

local anotherTbl = {
	[1] = function() end,
	[2] = function() end,
}

local ClassMeta = {

	__tostring = tbl.something,
	__concat = tbl.Concatenate,
	__len = tbl.GetDigitsCount,
	__unm = tbl.Unary,
	__add = tbl.Add,
	__sub = tbl.Subtract,
	__mul = tbl.Multiply,
	__div = tbl.Divide,
	__mod = tbl.Modulo,
	__pow = tbl.Power,
	__eq = tbl.EqualTo,
	__lt = tbl.LessThan,
	__le = tbl.LessThanOrEqualTo,

}

Most of the unnecessary code that is not related to the issue has been removed.

Steps to Reproduce: Compile the script with native code generation
Expected Behavior: The script should be compiled and executed natively without errors.
Actual Behavior: The script fails native code generation with the above error message and is interpreted instead.

Device specification
Processor AMD Ryzen 9 7900X 12-Core Processor 4.70 GHz
System type 64-bit operating system, x64-based processor

Operating System is Windows 11

@Meifeng1510 Meifeng1510 added the bug Something isn't working label Jan 6, 2025
@vegorov-rbx vegorov-rbx self-assigned this Jan 6, 2025
@vegorov-rbx
Copy link
Collaborator

Thanks for the report.
We are able to reproduce the issue and the code that causes it.
It's a bit similar to a different open issue we have, but I'll keep it open as an extra example and progress tracking.
Will be working towards fixing this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants