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

Types defined even when an error happens #5009

Closed
nalimilan opened this issue Dec 2, 2013 · 5 comments
Closed

Types defined even when an error happens #5009

nalimilan opened this issue Dec 2, 2013 · 5 comments

Comments

@nalimilan
Copy link
Member

This is what I just got when writing bool instead of Bool:

julia> type DataValue
           value
           isna::bool
        end
ERROR: type: DataValue: in type definition, expected Type{T<:Top}, got Function

julia> type DataValue
           value
           isna::Bool
        end
ERROR: invalid redefinition of constant DataValue

So it looks like after an incorrect definition you end up with an incomplete type or something...

(Yes, newcomers are terrible testers, every stupid thing will be tried! ;-)

@StefanKarpinski
Copy link
Member

(Yes, newcomers are terrible testers, every stupid thing will be tried! ;-)

This is exactly what makes them the best testers! The half-initialized state for both types and modules is unfortunate and would be great to avoid.

@ivarne
Copy link
Member

ivarne commented Dec 2, 2013

The half-initialized state is at least something that can be fixed without fixing the more complex issue of recompiling the code that depends on assumed constants (like type declarations and method definitions).

gitfoxi pushed a commit to gitfoxi/julia that referenced this issue Dec 13, 2013
* upstream/master: (53 commits)
  edit embedding chapter
  formatting fixes
  Fix JuliaLang#5056
  more consitent/useful description of predicate in ie all()
  NEWS for JuliaLang#4042
  Add sparse matvec to perf benchmark (#4707)
  Use warn_once instead of warn (JuliaLang#5038)
  Use warn() instead of println in base/sprase/sparsematrix.jl
  allow scale(b,A) or scale(A,b) when b is a scalar as well as a vector, don't restrict scale unnecessarily to arrays of numbers (e.g. scaling arrays of arrays should work), and improve documentation for scale\!
  Added section about memory management
  added negative bitarray rolling
  More accurate linspace for types with greater precision than Float64
  add realmin realmax for BigFloat
  fix eps(realmax), add typemin and typemax for BigFloat
  fix JuliaLang#5025, ordering used by nextfloat/prevfloat
  roll back on errors during type definitions. fixes JuliaLang#5009
  improve method signature errors. fixes JuliaLang#5018
  update juliadoc
  add more asserts for casts
  Fix segfaulting on strstr() failure
  ...
@pygy
Copy link
Contributor

pygy commented Mar 4, 2014

I still get this using v0.3.0-prerelease+1658.

julia> type Fuu() end
ERROR: syntax: invalid type signature

julia> type Fuu end
ERROR: invalid redefinition of constant Fuu

@ivarne
Copy link
Member

ivarne commented Mar 4, 2014

@pygy What platform are you on. I do have either of the problems on OSX master as of yesterday?

@pygy
Copy link
Contributor

pygy commented Mar 4, 2014

Indeed, it's fixed in HEAD. My build was about 1 month old, but more recent than the 893033c commit that fixed the issue. I guess it got merged in between.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants