Kampfkarren/full-moon

Chaining optional type operator bug

jeparlefrancais opened this issue · 1 comments

(At this point I suppose this is already fixed in the parser rewrite but I just want to make sure!)

Luau syntax allow chaining multiple optional type operators ?. You may think adding multiple ? to your type is redundant, but not at all. It allows you to write different levels of optional-ness:

type Config = {
    option1: string??, -- you probably need it once in a while
    option2: string???, -- once a year
    option3: string?????? -- once in your life!
}

Unfortunately, full-moon does not support it 😛 Jokes aside, it would be cool to fix this so that I don't have to add specific rules in darklua fuzz tests and code generators!

Can confirm, fixed in rewrite :) I'll add a test case for it