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

Precompilation causes tuple construction error at REPL #29936

Closed
cstjean opened this issue Nov 5, 2018 · 4 comments
Closed

Precompilation causes tuple construction error at REPL #29936

cstjean opened this issue Nov 5, 2018 · 4 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior compiler:precompilation Precompilation of modules

Comments

@cstjean
Copy link
Contributor

cstjean commented Nov 5, 2018

Here's the MWE. In package Foo:

module Foo

const global m = Val{nothing}()
const global h = Val{:hey}()

wab = [("a", m),
       ("b", h),]

end

At the REPL:

julia> using Foo; [("Plan", Foo.m), ("Plan", Foo.h),]
ERROR: TypeError: in arrayset, expected Tuple{String,Val}, got Tuple{String,Val{nothing}}
Stacktrace:
 [1] setindex! at ./array.jl:769 [inlined]
 [2] copyto!(::Array{Tuple{String,Val},1}, ::Tuple{Tuple{String,Val{nothing}},Tuple{String,Val{:hey}}}) at ./abstractarray.jl:649
 [3] vect(::Tuple{String,Val{nothing}}, ::Vararg{Any,N} where N) at ./array.jl:151
 [4] top-level scope at none:0

On Julia 1.0.1, Linux binary. FWIW, I encountered several segfaults on the way to this MWE.

edit: simplified example.

@cstjean cstjean changed the title Precompilation or packages causes tuple construction error at REPL Precompilation causes tuple construction error at REPL Nov 5, 2018
@ajkeller34
Copy link
Contributor

The MWE's error message should probably read:

ERROR: TypeError: in arrayset, expected Tuple{String,Val}, got Tuple{String,Val{nothing}}
Stacktrace:
 [1] setindex! at ./array.jl:769 [inlined]
 [2] copyto!(::Array{Tuple{String,Val},1}, ::Tuple{Tuple{String,Val{nothing}},Tuple{String,Val{:hey}}}) at ./abstractarray.jl:649
 [3] vect(::Tuple{String,Val{nothing}}, ::Vararg{Any,N} where N) at ./array.jl:151
 [4] top-level scope at none:0

@cstjean
Copy link
Contributor Author

cstjean commented Nov 6, 2018

Fixed, thank you.

@iamed2
Copy link
Contributor

iamed2 commented Jan 29, 2019

Still happens on 1.1

@JeffBezanson JeffBezanson self-assigned this Feb 12, 2019
@JeffBezanson JeffBezanson added bug Indicates an unexpected problem or unintended behavior compiler:precompilation Precompilation of modules labels Feb 12, 2019
@iamed2
Copy link
Contributor

iamed2 commented Feb 12, 2019

Thanks @JeffBezanson!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior compiler:precompilation Precompilation of modules
Projects
None yet
Development

No branches or pull requests

4 participants