Table of Contents

RDC11025: Array given a second empty argument list

Severity: Warning  ·  Family: RDC (Rubberduck Core analyzers)  ·  Raised by: ArrayGivenASecondEmptyArgumentListAnalyzer

An array is written with two empty argument lists, f()(). The specification says it is invalid, and MS-VBA compiles it, and fails when it runs.

An array written with an empty argument list is the array itself: f() is f. The specification takes an empty argument list only of an array that "an empty argument list has not already been specified for" (MS-VBAL §5.6.13), so the second one matches no rule, and f()() is invalid. In Excel, UBound(f()()) and v = f()() compile, and each raises run-time error 9 (Subscript out of range) whenever it runs, of a fixed-size array and of a dynamic one alike (recorded in Excel, oracle\s53).

RD-VBA does as MS-VBA does: the code compiles, and raises 9 when it runs. This warning stands for what the specification says.

How it is raised

Situation Example Resolution
An array given a second empty argument list. Debug.Print UBound(Values()()) Write the array once: Values(), or Values.

See also


ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca