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

Self reference on static function isn't working on 4.2.dev3 #80599

Closed
stephannv opened this issue Aug 13, 2023 · 1 comment
Closed

Self reference on static function isn't working on 4.2.dev3 #80599

stephannv opened this issue Aug 13, 2023 · 1 comment

Comments

@stephannv
Copy link

Godot version

Godot Engine v4.2.dev3.official.013e8e3af

System information

Vulkan API 1.2.231 - Forward Mobile - Using Vulkan Device #0: Apple - Apple M1 Max

Issue description

Creating a static function and referencing self class on function body isn't working anymore on 4.2.dev3 (I was using 4.2.dev1 and it was working fine. I tested on 4.2.dev2 and it worked too).
Example:

extends Node2D

class MyConfig:
  var x: int

  static func build_config(x: int) -> MyConfig:
    var my_config: MyConfig = MyConfig.new()
    my_config.x = 3

    return my_config

func _ready() -> void:
  MyConfig.build_config(3)

Error Parser Error: Identifier not found: MyConfig on var my_config: MyConfig = MyConfig.new().

Steps to reproduce

Download mrp and run node_2d.tscn scene

Minimal reproduction project

static_self_ref.zip

@dalexeev
Copy link
Member

Thanks for reporting the bug nonetheless!

@dalexeev dalexeev closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2023
@dalexeev dalexeev removed this from the 4.2 milestone Aug 14, 2023
@dalexeev dalexeev removed their assignment Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants