ZScript Syntax for referring to an inner type is broken

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

ZScript Syntax for referring to an inner type is broken

Postby Gutawer » Wed Feb 02, 2022 5:03 pm

Types like .Outer.Inner in ZScript aren't handled properly and appear to just look at the first element in the dottable_id. Making this syntax work properly would be pretty useful as right now it makes inner types fairly hard to use and often not worth bothering with.

Example:
Code: Select allExpand view
class Outer {
    struct Inner {}
   
    int m;
    int f(.Outer.Inner x) { return x.m; }
}

This code shouldn't really be expected to compile as it tries to access a thing that doesn't exist on Inner, but the function is actually compiled as referring to the wrong type (namely Outer) so it works with wrong behaviour.
User avatar
Gutawer
User Accounts Assistant
 
Joined: 16 Apr 2016
Discord: Gutawer#3431

Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests