Skip to content

[bug] overloading = true causes clashes when enum field and const have the same name #148

@heysokam

Description

@heysokam
# Errors
proc rename (
    name        : string;
    kind        : futhark.SymbolKind;
    partOf      : string;
    overloading : var bool;
  ) :string=
  overloading = true

importc:
  renameCallback rename
  outputPath currentSourcePath.parentDir/"result.nim"
  "vulkan/vulkan_core.h"
futhark.nim(420, 11) Error: redefinition of 'VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT'; previous declaration here: futhark.nim(420, 11)
# Works fine
importc:
  outputPath currentSourcePath.parentDir/"result_raw.nim"
  "vulkan/vulkan_core.h"
# Hints at the problematic name being renamed:
futhark.nim(249, 5) Hint: Renaming "VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT" to "VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT_enumval" [User]

Real usage example can be found at:
https://github.com/heysokam/vulkan.nim/tree/master/gen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions