• Jakob Petsovits's avatar
    Fix shadowing of C++ type names by similar method names. · 5d0e60b8
    Jakob Petsovits authored
    This can be triggered by the following kinds of methods:
    
    ```
    Conflict = interface +c {
    }
    conflict_user = interface +c {
        # Invalid method:
        # std::shared_ptr<Conflict> Conflict();
        # The template argument refers to the method name, not the type.
        Conflict(): Conflict;
    
        # Invalid method:
        # void conflict_arg(const std::set<std::shared_ptr<Conflict>>& cs);
        # The other method name still shadows the 'Conflict' type.
        conflict_arg(cs: set<Conflict>): bool;
    }
    ```
    
    (This is more of an issue when the target C++ naming convention
    uses lower-case names for both types and methods, as is common
    in e.g. Boost or C++ standard library names.)
    
    Both are fixed by using the type's fully qualified name
    if the scope contains conflicting names/symbols.
    5d0e60b8
CppMarshal.scala 9.2 KB