Skip to content

=== comparison changes behaviour in local scope #31583

Closed
@nilshg

Description

@nilshg

This came up on Slack and I've subsequently posted on Discourse here. An MWE would be the following:

a = "a"
@show a === "a" # true
for _ in 1:1
    @show a === "a" # false
    @show a .=== "a" # true
end

and similarly:

f() = a === "a" # false

Output of versioninfo():

Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = "C:\ProgramData\LONNG9\atom\app-1.35.1\atom.exe"  -a
  JULIA_NUM_THREADS = 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorcompiler:codegenGeneration of LLVM IR and native code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions