Skip to content

1 .>: 1 doesn't throw error #41299

@MarcMush

Description

@MarcMush

the broadcasted supertype (.>:) has a strange behavior, defaulting to true when it should error

this seems to be an old bug since I could replicate this in Julia 1.0

Note that this doesn't happen with .<: or >:

julia> 1 >: 1
ERROR: TypeError: in <:, expected Type, got a value of type Int64
Stacktrace:
 [1] >:(a::Any, b::Any)
   @ Base .\operators.jl:30
 [2] top-level scope
   @ REPL[147]:1

julia> 1 .>: 1
true

julia> 1 .<: 1
ERROR: TypeError: in <:, expected Type, got a value of type Int64
Stacktrace:
 [1] _broadcast_getindex_evalf
   @ .\broadcast.jl:648 [inlined]
 [2] _broadcast_getindex
   @ .\broadcast.jl:621 [inlined]
 [3] getindex
   @ .\broadcast.jl:575 [inlined]
 [4] copy
   @ .\broadcast.jl:898 [inlined]
 [5] materialize(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0}, Nothing, typeof(<:), Tuple{Int64, Int64}})
   @ Base.Broadcast .\broadcast.jl:883
 [6] top-level scope
   @ REPL[149]:1

julia> [1,2] .>: [3,4]
2-element BitVector:
 1
 1

julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorcompiler:optimizerOptimization passes (mostly in base/compiler/ssair/)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions