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

Issues with container spec #112

Open
kalinon opened this issue Jan 8, 2021 · 1 comment
Open

Issues with container spec #112

kalinon opened this issue Jan 8, 2021 · 1 comment

Comments

@kalinon
Copy link
Contributor

kalinon commented Jan 8, 2021

Seems aliasing is broken, unsure when it broke, but it should be reproducible with the container spec.

$ crystal spec spec/integration/containers_spec.cr
+ rm -f '*.o' containers.cpp containers_test.cr
Invalid alias name "std::vector<int>" at Test::Binding::std::vector<int>
Invalid alias name "std::vector<std::vector<int>>" at Test::Binding::std::vector<std::vector<int>>
Invalid alias name "std::vector<std::string>" at Test::Binding::std::vector<std::string>
Invalid alias name "std::vector<rgb>" at Test::Binding::std::vector<rgb>
Invalid alias name "std::vector<double>" at Test::Binding::std::vector<double>
Result type std::vector<int> is unreachable at Test::Binding#integers()
Result type std::vector<std::vector<int>> is unreachable at Test::Binding#grid()
Result type std::vector<std::string> is unreachable at Test::Binding#strings()
Result type std::vector<rgb> is unreachable at Test::Binding#palette()
Argument 2 has unreachable type std::vector<double> at Test::Binding#sum(list)
Result type Binding::std::vector<int> is unreachable at Test::Containers#integers()
Result type Binding::std::vector<std::vector<int>> is unreachable at Test::Containers#grid()
Result type Binding::std::vector<std::string> is unreachable at Test::Containers#strings()
Result type Binding::std::vector<rgb> is unreachable at Test::Containers#palette()
Argument 1 has unreachable type Binding::std::vector<double> at Test::Containers#sum(list)
Found 15 errors.  Aborting.
F

Failures:

  1) container instantiation feature works
     Failure/Error: tool.run!.should eq(0)

       Expected: 0
            got: 1

     # spec/integration/spec_helper.cr:80

Finished in 611.09 milliseconds
1 examples, 1 failures, 0 errors, 0 pending

Failed examples:

crystal spec spec/integration/containers_spec.cr:4 # container instantiation feature works
@kalinon
Copy link
Contributor Author

kalinon commented Jan 9, 2021

Still get these errors on other llvm versions, so i believe it may have something to do with the changes @HertzDevil may have introduced. @HertzDevil any ideas? Looks like types like std::vector<int> are making through as crystal code. Disabling sanity checks gets output like:

  @[Link(ldflags: "#{__DIR__}/../tmp/containers.o -lstdc++ -lgccpp")]
  lib Binding
    alias Containers = Void
    alias std::vector<int> = Void
    alias std::vector<std::vector<int> > = Void
    alias std::vector<std::string> = Void
    alias ContainerStdVectorUnsignedChar = Void
    alias std::vector<rgb> = Void
    alias std::vector<double> = Void

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