ZScript Syntax for referring to an inner type is broken

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Gutawer
User Accounts Assistant
Posts: 460
Joined: Sat Apr 16, 2016 6:01 am
Discord: Gutawer#3431
Preferred Pronouns: She/Her

ZScript Syntax for referring to an inner type is broken

Post by Gutawer »

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 all

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
randi
Site Admin
Posts: 7728
Joined: Wed Jul 09, 2003 10:30 pm

Re: ZScript Syntax for referring to an inner type is broken

Post by randi »

Return to “Closed Bugs”