Jump to content

Photo

[2.55 a92][CRASH] Untyped Args, Overloading, Namespaces.


  • Please log in to reply
1 reply to this topic

#1 Orithan

Orithan

    Studying Scientist - Commission from Silvixen

  • Members
  • Location:Australia

Posted 02 July 2021 - 12:02 PM

Version: Zelda Classic 2.55 Alpha 92

OS: Windows 10

 

Description:

This code crashes ZQ's compiler:

namespace AmongUs
{
    void Operations()
    {
        untyped imposter = 0;
        Jobs(imposter);
    }
    void Jobs(int str)
    {
    }
    void Jobs(char32 str)
    {
    }
}
It hangs up at Pass4 for a little while before the crash occurs.

What specifically causes this crash is fairly specific but you might run into it if you work with namespaces:
Passing an untyped pointer into a function that is overloaded to use different pointer types as args, with the different pointer type being in the same slot. It also has to be placed within a namespace.

If this code is placed out of a namespace, we instead get a compiler error.
..\ZC Repos\Spirit_zh\spirit_zh\Scripts.zh Line 217 @ Columns 2-31 - Error T022: There are too many choices for function Jobs(untyped).
        The possible choices are:
        Jobs(float)
        Jobs(char32)


#2 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 03 July 2021 - 08:17 AM

Fixed for next build




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users