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

UML compiler doesn't support functions outside scripts #1945

Open
ChronoVortex opened this issue Oct 7, 2024 · 0 comments
Open

UML compiler doesn't support functions outside scripts #1945

ChronoVortex opened this issue Oct 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ChronoVortex
Copy link

Describe the bug

Attempting to compile this GML code in an object's creation event

anon_func = function()
{
    show_debug_message("ANON FUNC");
};

anon_func();

Results in this error

;  EXCEPTION!
;   System.ArgumentException: An item with the same key has already been added. Key: 1
;   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
;   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
;   at UndertaleModLib.Decompiler.Disassembler.Disassemble(UndertaleCode code, IList`1 vars, UndertaleCodeLocals locals) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModLib\Decompiler\Disassembler.cs:line 58
;   at UndertaleModTool.UndertaleCodeEditor.DisassembleCode(UndertaleCode code, Boolean first) in D:\a\UndertaleModTool\UndertaleModTool\UndertaleModTool\Editors\UndertaleCodeEditor.xaml.cs:line 531

Reproducing steps

Attempt to compile a non-script function.

Setup Details

Reproduced on a test project compiled in the latest release of GMS2.
data.zip

@ChronoVortex ChronoVortex added the bug Something isn't working label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant