You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 2.0 update broke patterns that look like a.b. Having these patterns is useful for working with EnumX enums because they have to be accessed through their generated module.
With Match@1.2.0:
julia>using EnumX, Match
julia>@enumx Fruit APPLE BANANA PEAR
julia> fruit = Fruit.APPLE
Fruit.APPLE =0
julia>@match fruit begin
Fruit.APPLE =>0
Fruit.BANANA =>1
Fruit.PEAR =>2end0
With Match@2.0.0:
julia>using EnumX, Match
julia>@enumx Fruit APPLE BANANA PEAR
julia> fruit = Fruit.APPLE
Fruit.APPLE =0
julia>@match fruit begin
Fruit.APPLE =>0
Fruit.BANANA =>1
Fruit.PEAR =>2end
ERROR: LoadError: REPL[5]:2: Unrecognized pattern syntax `Fruit.APPLE`.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] bind_pattern!(location::LineNumberNode, source::Expr, input::Symbol, binder::Match.BinderContext, assigned::Base.ImmutableDict{Symbol, Symbol})
@ Match ~/.julia/packages/Match/SZDEk/src/binding.jl:408
[3] bind_case(case_number::Int64, location::LineNumberNode, case::Expr, predeclared_temps::Vector{Any}, binder::Match.BinderContext)
@ Match ~/.julia/packages/Match/SZDEk/src/binding.jl:580
[4] build_automaton_core(value::Symbol, source_cases::Vector{Any}, location::LineNumberNode, predeclared_temps::Vector{Any}, binder::Match.BinderContext)
@ Match ~/.julia/packages/Match/SZDEk/src/match_cases_opt.jl:15
[5] build_automaton(location::LineNumberNode, mod::Module, value::Any, body::Expr)
@ Match ~/.julia/packages/Match/SZDEk/src/match_cases_opt.jl:149
[6] build_deduplicated_automaton
@ ~/.julia/packages/Match/SZDEk/src/match_cases_opt.jl:158 [inlined]
[7] handle_match_cases(location::LineNumberNode, mod::Module, value::Symbol, body::Expr)
@ Match ~/.julia/packages/Match/SZDEk/src/match_cases_opt.jl:477
[8] var"@match"(__source__::LineNumberNode, __module__::Module, value::Any, cases::Any)
@ Match ~/.julia/packages/Match/SZDEk/src/matchmacro.jl:114
in expression starting at REPL[5]:1
The text was updated successfully, but these errors were encountered:
jonniediegelman
changed the title
Patterns with getproperty access broke
Patterns with getproperty access broke in v2.0.0
Aug 4, 2023
The 2.0 update broke patterns that look like
a.b
. Having these patterns is useful for working withEnumX
enums because they have to be accessed through their generated module.With Match@1.2.0:
With Match@2.0.0:
The text was updated successfully, but these errors were encountered: