Ticket #151 (closed defect: fixed)
incomplete support for vari nilable parameters
Reported by: | jonathandavid | Owned by: | Chuck |
---|---|---|---|
Priority: | medium | Milestone: | |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | nilable, vari | Cc: | Chuck |
Description
The following code does not behave as expected:
class Test def takesVari(x as vari String) is shared for y in x print y def takesArray(x as String[]) is shared for y in x print y def main is shared .takesVari(@['hola', nil]) # compiles fine, no runtime assertion .takesArray(@['hola', nil]) # does not even compile
The call to "takesVari" should have caused a compilation error, just like the [] version does.
Cobra accepts the syntax fun(x as vari String?), but the resulting code behaves as if the "?" wasn't there at all.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.