YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
25 stars 8 forks source link

Static methods defined in inherited constructors crash the game: "calling a constructor directly - constructors should only be called using new" #7762

Closed DragoniteSpam closed 1 month ago

DragoniteSpam commented 1 month ago

Description

Presumably this is related to the constructor_call shenanigans that yall have been talking about today

calling a constructor directly - constructors should only be called using new

function A() constructor {
    static Whatever = function() {

    };
}

function B() : A() constructor {

}

show_message(new A())
show_message(new B())

Steps To Reproduce

Run the sample project

Which version of GameMaker are you reporting this issue for?

IDE v2024.1100.0.626 Runtime v2024.1100.0.652

Which operating system(s) are you seeing the problem on?

Windows 10.0.19045.0

Which platform(s) are you seeing the problem on?

Windows

4f34c39a-e552-454b-a910-64cba464cb25

DragoniteSpam commented 1 month ago

Actually you know what - statics have nothing to do with it, and this is probably just #7752