mauro3 / SimpleTraits.jl

Simple Traits for Julia
MIT License
159 stars 14 forks source link

UndefVarError while loading package on Julia 0.7 #48

Closed iamed2 closed 6 years ago

iamed2 commented 7 years ago
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-DEV.2129 (2017-10-12 18:00 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit ed7c7ad1bc (0 days old master)
|__/                   |  x86_64-apple-darwin17.0.0

julia> using SimpleTraits

WARNING: deprecated syntax "immutable" at /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:106.
Use "struct" instead.

WARNING: deprecated syntax "type" at /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:433.
Use "mutable struct" instead.
INFO: Precompiling module SimpleTraits.

WARNING: deprecated syntax "immutable" at /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:106.
Use "struct" instead.

WARNING: deprecated syntax "type" at /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:433.
Use "mutable struct" instead.
WARNING: current_module() is deprecated, use `@__MODULE__` instead.
Stacktrace:
 [1] depwarn(::String, ::Symbol) at ./deprecated.jl:68
 [2] current_module() at ./deprecated.jl:1297
 [3] include_relative(::Module, ::String) at ./loading.jl:533
 [4] include(::Module, ::String) at ./sysimg.jl:14
 [5] anonymous at ./<missing>:2
 [6] eval(::Module, ::Expr) at ./sysimg.jl:53
 [7] process_options(::Base.JLOptions) at ./client.jl:307
 [8] _start() at ./client.jl:391
in expression starting at /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:6

WARNING: deprecated syntax "parametric method syntax stripNot{T <: Trait}(::Type{T}) around /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:44".
Use "stripNot(#unused#::Type{T}) where T <: Trait" instead.

WARNING: deprecated syntax "parametric method syntax stripNot{T <: Trait}(::Type{Not{T}}) around /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:45".
Use "stripNot(#unused#::Type{Not{T}}) where T <: Trait" instead.

WARNING: deprecated syntax "parametric method syntax stripNot{T <: Trait}(::Type{Not{Not{T}}}) around /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:46".
Use "stripNot(#unused#::Type{Not{Not{T}}}) where T <: Trait" instead.

WARNING: deprecated syntax "parametric method syntax trait{T <: Trait}(::Type{T}) around /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:64".
Use "trait(#unused#::Type{T}) where T <: Trait" instead.

WARNING: deprecated syntax "parametric method syntax trait{T <: Trait}(::Type{Not{T}}) around /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:65".
Use "trait(#unused#::Type{Not{T}}) where T <: Trait" instead.

WARNING: deprecated syntax "parametric method syntax istrait{T <: Trait}(tr::Type{T}) around /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:84".
Use "istrait(tr::Type{T}) where T <: Trait" instead.
Use of final value of loop variable "i" around /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:281 is deprecated. In the future the variable will be local to the loop instead.
ERROR: LoadError: LoadError: LoadError: UndefVarError: Tr not defined
Stacktrace:
 [1] macro expansion at /Users/ericdavies/.julia/v0.7/MacroTools/src/macro.jl:14 [inlined]
 [2] @traitimpl(::LineNumberNode, ::Module, ::Any) at /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:168
 [3] include_relative(::Module, ::String) at ./loading.jl:533
 [4] include at ./sysimg.jl:14 [inlined]
 [5] include(::String) at /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:3
 [6] include_relative(::Module, ::String) at ./loading.jl:533
 [7] include(::Module, ::String) at ./sysimg.jl:14
 [8] anonymous at ./<missing>:2
in expression starting at /Users/ericdavies/.julia/v0.7/SimpleTraits/src/base-traits.jl:11
in expression starting at /Users/ericdavies/.julia/v0.7/SimpleTraits/src/base-traits.jl:11
in expression starting at /Users/ericdavies/.julia/v0.7/SimpleTraits/src/SimpleTraits.jl:522
ERROR: Failed to precompile SimpleTraits to /Users/ericdavies/.julia/lib/v0.7/SimpleTraits.ji.
Stacktrace:
 [1] compilecache(::String) at ./loading.jl:661
 [2] _require(::Symbol) at ./loading.jl:472
 [3] require(::Symbol) at ./loading.jl:324

I have time to dedicate to fixing this to submit a PR but I need help to figure out what's going on. I just have wild guesses at this point as I'm not familiar with SimpleTraits and I'm barely acquainted with MacroTools. My main motivation is getting LightGraphs working.

iamed2 commented 7 years ago

Looks like this is a MacroTools bug which is fixed on master of that package.

mauro3 commented 7 years ago

Thanks! Note, that if you are also concerned about deprecations: with moving to where syntax, there is a slight problem: https://github.com/mauro3/SimpleTraits.jl/issues/46 . I've been exploring some alternatives on https://github.com/mauro3/SimpleTraits.jl/tree/m3/associated-types (among other things).

mauro3 commented 7 years ago

(Also note, that I'm on vacation from tomorrow for a week, so I probably can't help then.)

iamed2 commented 7 years ago

At this point I'm not too worried about deprecations as new ones could pop up at any time between now and 0.7 release. I just need packages to work so I can test that my packages work :)

I think just getting the version tagging going starting with MacroTools is all that's necessary. Once this package can set a lower bound on the next release of MacroTools then I can try to get LightGraphs to set a lower bound on this package, etc.

Until then I'll work on master everything

mauro3 commented 6 years ago

I just updated the package to run again on 0.7 (on master for now, but I could tag if desired). However the parametric method deprecations remain, for now.