Skip to content

VBA allows "overloads" of aliased functions. RD is confused... #2793

@comintern

Description

@comintern

Apparently, the hack that VBA uses to support forwarding the type hinted functions (i.e. Left and Left$) lets you "override" them as variables by specifying a different type hint:

Sub IFoundYourDirtyBuggySecret()
    Format# = 42
    Debug.Print Format#
End Sub

For any function that isn't aliased to a pair of _B_var_Foo and _B_str_Foo, this would result in a compiler error:

Sub NotSoMuch()
    IIf# = 42    'Compile error:  Type-declaration character does not match declared data type
    Debug.Print IIf#
End Sub

This creates problems for RD, which is currently resolving them to the function:

untitled

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIdentifies work items for known bugsparse-tree-processingresolverIssue is easier to resolve with knowledge of the internal resolver API and the Antlr4 parse trees.

    Type

    No type

    Projects

    Status

    Backlog | Resolver

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions