Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An undefined variable doesn't raise an error #14878

Closed
IainNZ opened this issue Jan 31, 2016 · 11 comments
Closed

An undefined variable doesn't raise an error #14878

IainNZ opened this issue Jan 31, 2016 · 11 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@IainNZ
Copy link
Member

IainNZ commented Jan 31, 2016

Thing to look for is that junk in Weirdness is not defined

type Weird
    ext
end
Weird() = Weird(Dict())

type FooType
end
FooType(ng) = FooType()

function Weirdness()
    w = Weird()
    w.ext[:Iain] = FooType(junk)
    return w
end

versioninfo()
@show Weirdness()

On Julia 0.4.1:

$ jl WeirdStuff.jl
Julia Version 0.4.1
Commit cbe1bee* (2015-11-08 10:33 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin15.0.0)
  CPU: Intel(R) Core(TM) i7-4960HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
Weirdness() = Weird(Dict{Any,Any}(:Iain=>FooType()))

On master, just built:

$ j5 WeirdStuff.jl
Julia Version 0.5.0-dev+2432
Commit d550b37* (2016-01-31 15:11 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin15.2.0)
  CPU: Intel(R) Core(TM) i7-4960HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1
Weirdness() = Weird(Dict{Any,Any}(:Iain=>FooType()))

EDIT1: reduced complexity of code

EDIT2: no need for the kwargs

@IainNZ
Copy link
Member Author

IainNZ commented Jan 31, 2016

Oh, and one more piece of info: this is a reduced case, obviously. In the original case, I didn't even notice my mistake until it ran on Travis and failed - so something about Travis is different, possibly

@yuyichao
Copy link
Contributor

The travis failure is probably due to no inlining.

@JeffBezanson
Copy link
Member

Yep, inlining bug.

@JeffBezanson JeffBezanson added the bug Indicates an unexpected problem or unintended behavior label Jan 31, 2016
@KristofferC
Copy link
Member

Is this related? I acidentally added a random unicode character (a subscript k) to a line but all the tests passed. Is it because the statement was "effect free" and thus got dead code eliminated or something like that?

@yuyichao
Copy link
Contributor

That one should be fixed by #14756

@KristofferC
Copy link
Member

Ah, ok. Thanks.

@IainNZ
Copy link
Member Author

IainNZ commented Feb 26, 2016

This is still reproducible on master

@mschauer
Copy link
Contributor

@IainNZ Can be closed, right?

@yuyichao yuyichao added the needs tests Unit tests are required for this change label May 19, 2016
@IainNZ
Copy link
Member Author

IainNZ commented May 19, 2016

@mschauer Can it? Does not happen anymore?

@IainNZ
Copy link
Member Author

IainNZ commented May 19, 2016

Still was happening 12 days ago

@yuyichao
Copy link
Contributor

Seems to be fixed now. But need a test.

@IainNZ IainNZ self-assigned this May 19, 2016
@IainNZ IainNZ closed this as completed in 361322e May 20, 2016
IainNZ added a commit that referenced this issue May 20, 2016
Close #14878 by adding test for uncaught undef. var.
@tkelman tkelman removed the needs tests Unit tests are required for this change label May 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

6 participants