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

genbinding fails con dictionary type #21

Open
bluemax75 opened this issue Jul 7, 2022 · 1 comment
Open

genbinding fails con dictionary type #21

bluemax75 opened this issue Jul 7, 2022 · 1 comment

Comments

@bluemax75
Copy link
Contributor

When trying to generate the bindings for an interface with dictionary parameters:

<interface name='interfacename'>
    <method name='methodname'>
      <arg name='troubleparam' type='{ss}' direction='in'/>
    </method>
</interface>

genbinding fails with:

/home/charly/tmp/nim/dbus/genbinding.nim(21) genbinding
/home/charly/.nimble/pkgs/dbus-#HEAD/dbus/gennim.nim(75) genMethodWrapper
/home/charly/.nimble/pkgs/dbus-#HEAD/dbus/gennim.nim(40) genType
Error: unhandled exception: unsupported type [DbusException]

I was able to follow the problem to the genType procedure in gennim.nim
It is missing the dtDictEntry value. I understand it should be added as the struct:

    of dtDictEntry:
      return "TableRef[" & genType(kind.keyType) & ", " & genType(kind.valueType) & "]"

At least it seems to generate a reasonable output

@zielmicha
Copy link
Owner

Adding support for dicts seems useful, you are welcome to try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants