Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix regression with imported distinct types #1418

Merged
merged 1 commit into from
Aug 15, 2024

Commits on Aug 14, 2024

  1. fix regression with imported distinct types

    Summary
    =======
    
    Marking a `distinct T` type as imported resulted in multiple C
    definitions for `T`, if `T` is a non-numeric, non-pointer type. This is
    now fixed.
    
    Details
    =======
    
    When translating imported types, `mirtypes` always created a new type
    symbol for the imported type's underlying type. For `tyAlias` and
    `tyDistinct` types (or any other type kind in the `Skip` set), this
    resulted in a duplicate of the underlying type symbol being created.
    Since MIR types are identified by ID, both look separate to `cgen`, and
    thus a C definition is emitted for each.
    
    `handleImportedTypes` now goes through the caching mechanism for the
    underlying type if its not the type marked with `.importc`, fixing the
    issue.
    zerbina committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    0b6f5ca View commit details
    Browse the repository at this point in the history