Skip to content

Nested functions are not cross-module inlined #1603

@JohanEngelen

Description

@JohanEngelen

E.g. with this code in a module:

pragma(inline, true)
bool outerFunc()
{
    pragma(inline, true)
    bool innerFunc()
    {
        return true;
    }

    return innerFunc();
}

innerFunc will not be available for inlining (available_externally) when outerFunc is called from another module.
At least part of the problem is that the nested function has already passed semantic3 during the defineAsExternallyAvailable checks, see 75e1573#diff-db5a49fcfce323871f6dcb6886c9155eR139

Also see #1577 .

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions