help? type (in 0.7)

Typing: ? type gives an error:

help?> type
ERROR: LoadError: Invalid @var syntax incomplete: premature end of input .
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] splitexpr(::Any) at ./docs/bindings.jl:28
[3] bindingexpr(::Any) at ./docs/bindings.jl:17
[4] lookup_doc(::Expr) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/REPL/src/docview.jl:137
[5] docm(::LineNumberNode, ::Module, ::Any) at ./docs/Docs.jl:501
[6] @doc(::LineNumberNode, ::Module, ::Expr, ::Vararg{Expr,N} where N) at ./boot.jl:451
in expression starting at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/REPL/src/docview.jl:301

that’s because type is a preserved word for defining struct in Julia-v0.6 and before, it was deprecated in Julia-v0.7, so in Julia-v1.0 there is no error:

help?> type
search: Type typeof typemin typemax TypeVar typejoin typeassert TypeError typeintersect oftype eltype valtype keytype subtypes fieldtype

Couldn't find type
Perhaps you meant Type, typeof, eltype, oftype, time, tuple, Pipe, typemax, typemin, keytype, valtype, try, take!, tan, tand, tanh or trues
  No documentation found.

  Binding type does not exist.
1 Like

The point was that it produced ERROR: LoadError: Invalid @var syntax incomplete: premature end of input . Stacktrace: and not the message one normally gets. As you say, the same thing is fine in V1.0.0 and v0.6.4.

I got the same error in v0.6.3:

  | | |_| | | | (_| |  |  Version 0.6.3 (2018-05-28 20:20 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-apple-darwin14.5.0

help?> type
ERROR: Invalid @var syntax `incomplete: premature end of input`.

help?> immutable
ERROR: Invalid @var syntax `incomplete: premature end of input`.

don’t know why Julia treats these two statements so special.