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

Regression: tuple sizeof is incorrect if contains imported object #9794

Closed
cooldome opened this issue Nov 24, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@cooldome
Copy link
Member

commented Nov 24, 2018

type
  Vector* {.importcpp: "std::vector", header: "vector", bycopy.}[T] = object
  Pod = object
    v* : Vector[int]
    seed*: int

  Pod2 = tuple[v: Vector[int], seed: int]

proc test() =
  echo sizeof(Pod), " == ",sizeof(Pod2)
test()

The following example outputs 32 == 8 on the latest nim.
Works as expected on 0.18.x version prints 32 == 32.

Looks like semfold has kicked in latest nim

@cooldome cooldome changed the title Regression: tuple sizeof is incorrect if contains imported objects Regression: tuple sizeof is incorrect if contains imported object Nov 24, 2018

@cooldome

This comment has been minimized.

Copy link
Member Author

commented Nov 24, 2018

I have a fix

cooldome added a commit to cooldome/Nim that referenced this issue Nov 24, 2018

cooldome added a commit to cooldome/Nim that referenced this issue Nov 24, 2018

@Araq Araq closed this in ea5fc9f Nov 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.