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

When you use new method as a Callable, it will fail in release build. #101230

Open
KoBeWi opened this issue Jan 7, 2025 · 2 comments
Open

When you use new method as a Callable, it will fail in release build. #101230

KoBeWi opened this issue Jan 7, 2025 · 2 comments

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Jan 7, 2025

Tested versions

4.4 dev7

System information

W10

Issue description

When you use new method of a class as a Callable, it will fail in release build.

extends Node

class Test:
	pass

func _ready() -> void:
	var test = Test.new.call()
	print(test)

Prints the object in editor/debug build, in release build it results in

SCRIPT ERROR: Parse Error: Cannot find member "new" in base "Test".
          at: GDScript::reload (res://2DSequel.tscn::GDScript_1egr7:7)

Steps to reproduce

  1. Attach the above script to a node
  2. Export with release template
  3. Run

Minimal reproduction project (MRP)

N/A

@matheusmdx
Copy link
Contributor

Seems a regression between 4.0 beta 8 and 4.0 beta 9, i'll bisect.

@matheusmdx
Copy link
Contributor

Bisected to #69471, @rune-scape

Image


After this pr the the error that appears in the exported version was visible in the editor, but pr #73657 fixed this on editor, but seems to not work in the exported version.

Image

@fire fire changed the title new method not found in release build When you use new method of a Callable, it will fail in release build. Jan 7, 2025
@KoBeWi KoBeWi changed the title When you use new method of a Callable, it will fail in release build. When you use new method as a Callable, it will fail in release build. Feb 11, 2025
@github-project-automation github-project-automation bot moved this to For team assessment in GDScript Issue Triage Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: For team assessment
Development

No branches or pull requests

2 participants