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

Bug handling packages with same names #11

Open
magik6k opened this issue Feb 13, 2020 · 1 comment
Open

Bug handling packages with same names #11

magik6k opened this issue Feb 13, 2020 · 1 comment

Comments

@magik6k
Copy link
Collaborator

magik6k commented Feb 13, 2020

If I depend on a type from a different package with the same name, cbor-gen won't produce valid code

my/packag

package packag

type S struct {...}

other/packag

package packag

import "my/packag"

type T struct {
  F packag.S
}

Will generate code that won't compile

@sternhenri
Copy link

sternhenri commented Feb 13, 2020

A variant of this issue happens when packages are imported with an alias that isn't the exact package name:

my/foo

package foo

type S struct {...}

other/bar

package bar

import myFoo "my/foo"

type T struct {
  F myFoo.S
}

breaks

other/baz

package baz

import foo "my/foo"

type T struct {
  F foo.S
}

compiles

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