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

conflicts with optional compound types #10

Open
ghost opened this issue May 19, 2018 · 1 comment
Open

conflicts with optional compound types #10

ghost opened this issue May 19, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented May 19, 2018

Interactive Elixir (1.6.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> defmodule ToyStruct do
...(1)>   use XDR.Type.Struct, spec: [
...(1)>     counter: XDR.Type.Uint,
...(1)>     value: XDR.Type.Uint
...(1)>   ]
...(1)> end
{:module, ToyStruct,
 <<70, 79, 82, 49, 0, 0, 13, 84, 66, 69, 65, 77, 65, 116, 85, 56, 0, 0, 1, 67,
   0, 0, 0, 34, 16, 69, 108, 105, 120, 105, 114, 46, 84, 111, 121, 83, 116, 114,
   117, 99, 116, 8, 95, 95, 105, 110, 102, ...>>, {:decode, 2}}
iex(2)> defmodule OptionalToy do
...(2)>   use XDR.Type.Optional, for: ToyStruct
...(2)> end
warning: conflicting behaviours found. function valid?/1 is required by XDR.Type.Base and XDR.Type.Base (in module OptionalToy)
  iex:2

warning: conflicting behaviours found. function new/1 is required by XDR.Type.Base and XDR.Type.Base (in module OptionalToy)
  iex:2

warning: conflicting behaviours found. function length/0 is required by XDR.Type.Base and XDR.Type.Base (in module OptionalToy)
  iex:2

warning: conflicting behaviours found. function encode/1 is required by XDR.Type.Base and XDR.Type.Base (in module OptionalToy)
  iex:2

warning: conflicting behaviours found. function decode/1 is required by XDR.Type.Base and XDR.Type.Base (in module OptionalToy)
  iex:2

{:module, OptionalToy,
 <<70, 79, 82, 49, 0, 0, 11, 28, 66, 69, 65, 77, 65, 116, 85, 56, 0, 0, 1, 45,
   0, 0, 0, 28, 18, 69, 108, 105, 120, 105, 114, 46, 79, 112, 116, 105, 111,
   110, 97, 108, 84, 111, 121, 8, 95, 95, 105, ...>>, :ok}

is there anything to worry about with this?

@sunny-g
Copy link
Owner

sunny-g commented Jun 7, 2018

Hey @dexamphetamine, thanks for bringing this up. Not exactly sure what's causing this (as I thought I was using the XDR.Type.Base behaviour within the XDR.Type.Optional module correctly.

Regardless, I don't think it should cause any runtime errors, but please let me know if it does and/or if you find a solution!.

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

1 participant