Skip to content

Commit e3c05e4

Browse files
committed
fix bug for HModuleElts
1 parent 56f1ad3 commit e3c05e4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ModuleElts"
22
uuid = "4249f315-58d4-4c46-b324-3577fc7dfca0"
33
authors = ["Jean Michel <jean.michel@imj-prg.fr>"]
4-
version = "0.1.1"
4+
version = "0.1.2"
55

66
[compat]
77
julia = "1"

src/ModuleElts.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,17 +386,17 @@ for M in (:HModuleElt, :ModuleElt)
386386
@eval begin
387387

388388
# we assume that converting the keys from K to K1 does not change hashing
389-
# for the Dict implementation or sorting for the ModuleElt implementation
389+
# for the Dict implementation or sorting for the pairs implementation
390390
function Base.convert(::Type{$M{K,V}},a::$M{K1,V1}) where {K,K1,V,V1}
391391
if K==K1
392392
if V==V1 a
393393
elseif iszero(a) zero($M{K,V})
394-
else ModuleElt(k=>convert(V,v) for (k,v) in a.d;check=false)
394+
else $M(k=>convert(V,v) for (k,v) in a.d;check=false)
395395
end
396396
else
397397
if iszero(a) zero($M{K,V})
398-
elseif V==V1 ModuleElt(convert(K,k)=>v for (k,v) in a.d;check=false)
399-
else ModuleElt(convert(K,k)=>convert(V,v) for (k,v) in a.d;check=false)
398+
elseif V==V1 $M(convert(K,k)=>v for (k,v) in a.d;check=false)
399+
else $M(convert(K,k)=>convert(V,v) for (k,v) in a.d;check=false)
400400
end
401401
end
402402
end

0 commit comments

Comments
 (0)