diff --git a/base/abstractarray.jl b/base/abstractarray.jl index b8feeffa4d745..92874648302e1 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -804,8 +804,8 @@ typed_hcat{T}(::Type{T}) = Array{T}(0) ## cat: special cases vcat{T}(X::T...) = T[ X[i] for i=1:length(X) ] vcat{T<:Number}(X::T...) = T[ X[i] for i=1:length(X) ] -hcat{T}(X::T...) = T[ X[j] for i=1, j=1:length(X) ] -hcat{T<:Number}(X::T...) = T[ X[j] for i=1, j=1:length(X) ] +hcat{T}(X::T...) = T[ X[j] for i=1:1, j=1:length(X) ] +hcat{T<:Number}(X::T...) = T[ X[j] for i=1:1, j=1:length(X) ] vcat(X::Number...) = hvcat_fill(Array{promote_typeof(X...)}(length(X)), X) hcat(X::Number...) = hvcat_fill(Array{promote_typeof(X...)}(1,length(X)), X) diff --git a/base/arraymath.jl b/base/arraymath.jl index c89ac3c2d6a30..53a73c3b5ef66 100644 --- a/base/arraymath.jl +++ b/base/arraymath.jl @@ -322,8 +322,8 @@ function ctranspose(A::AbstractMatrix) end ctranspose{T<:Real}(A::AbstractVecOrMat{T}) = transpose(A) -transpose(x::AbstractVector) = [ transpose(v) for i=1, v in x ] -ctranspose{T}(x::AbstractVector{T}) = T[ ctranspose(v) for i=1, v in x ] #Fixme comprehension +transpose(x::AbstractVector) = [ transpose(v) for i=1:1, v in x ] +ctranspose{T}(x::AbstractVector{T}) = T[ ctranspose(v) for i=1:1, v in x ] _cumsum_type{T<:Number}(v::AbstractArray{T}) = typeof(+zero(T)) _cumsum_type(v) = typeof(v[1]+v[1]) diff --git a/base/inference.jl b/base/inference.jl index 7747386288874..e270b44a7e2ee 100644 --- a/base/inference.jl +++ b/base/inference.jl @@ -43,10 +43,8 @@ end type InferenceState sp::SimpleVector # static parameters label_counter::Int # index of the current highest label for this function - fedbackvars::Dict{SSAValue, Bool} mod::Module currpc::LineNum - static_typeof::Bool # info on the state of inference and the linfo linfo::LambdaInfo @@ -71,7 +69,6 @@ type InferenceState backedges::Vector{Tuple{InferenceState, Vector{LineNum}}} # iteration fixed-point detection fixedpoint::Bool - typegotoredo::Bool inworkq::Bool # optimization optimize::Bool @@ -158,13 +155,13 @@ type InferenceState inmodule = isdefined(linfo, :def) ? linfo.def.module : current_module() # toplevel thunks are inferred in the current module frame = new( - sp, nl, Dict{SSAValue, Bool}(), inmodule, 0, false, + sp, nl, inmodule, 0, linfo, la, s, Union{}, W, n, cur_hand, handler_at, n_handlers, ssavalue_uses, ssavalue_init, ObjectIdDict(), #Dict{InferenceState, Vector{LineNum}}(), Vector{Tuple{InferenceState, Vector{LineNum}}}(), - false, false, false, optimize, inlining, needtree, false) + false, false, optimize, inlining, needtree, false) push!(active, frame) nactive[] += 1 return frame @@ -1068,8 +1065,6 @@ function abstract_eval(e::ANY, vtypes::VarTable, sv::InferenceState) return abstract_eval_constant(e) end e = e::Expr - # handle: - # call null new & static_typeof if is(e.head,:call) t = abstract_eval_call(e, vtypes, sv) elseif is(e.head,:null) @@ -1103,42 +1098,6 @@ function abstract_eval(e::ANY, vtypes::VarTable, sv::InferenceState) t = abstract_eval_constant(val) end end - elseif is(e.head,:static_typeof) - var = e.args[1] - t = widenconst(abstract_eval(var, vtypes, sv)) - if isa(t,DataType) && typeseq(t,t.name.primary) - # remove unnecessary typevars - t = t.name.primary - end - if is(t,Bottom) - # if we haven't gotten fed-back type info yet, return Bottom. otherwise - # Bottom is the actual type of the variable, so return Type{Bottom}. - if get!(sv.fedbackvars, var, false) - t = Type{Bottom} - else - sv.static_typeof = true - end - elseif isleaftype(t) - t = Type{t} - elseif isleaftype(sv.linfo.specTypes) - if isa(t,TypeVar) - t = Type{t.ub} - else - t = Type{t} - end - else - # if there is any type uncertainty in the arguments, we are - # effectively predicting what static_typeof will say when - # the function is compiled with actual arguments. in that case - # abstract types yield Type{<:T} instead of Type{T}. - # this doesn't really model the situation perfectly, but - # "isleaftype(inference_stack.types)" should be good enough. - if isa(t,TypeVar) || isvarargtype(t) - t = Type{t} - else - t = Type{TypeVar(:_,t)} - end - end elseif is(e.head,:method) t = (length(e.args) == 1) ? Any : Void elseif is(e.head,:copyast) @@ -1666,7 +1625,6 @@ function typeinf_frame(frame) W = frame.ip s = frame.stmt_types n = frame.nstmts - @label restart_typeinf while !isempty(W) # make progress on the active ip set local pc::Int = first(W), pc´::Int @@ -1674,15 +1632,12 @@ function typeinf_frame(frame) #print(pc,": ",s[pc],"\n") delete!(W, pc) frame.currpc = pc - frame.static_typeof = false frame.cur_hand = frame.handler_at[pc] stmt = frame.linfo.code[pc] changes = abstract_interpret(stmt, s[pc]::Array{Any,1}, frame) if changes === () - # if there was a Expr(:static_typeof) on this line, - # need to continue to the next pc even though the return type was Bottom - # otherwise, this line threw an error and there is no need to continue - frame.static_typeof || break + # this line threw an error and there is no need to continue + break changes = s[pc] end if frame.cur_hand !== () @@ -1732,26 +1687,6 @@ function typeinf_frame(frame) s[l] = newstate end end - elseif is(hd, :type_goto) - for i = 2:length(stmt.args) - var = stmt.args[i]::SSAValue - # Store types that need to be fed back via type_goto - # in ssavalue_init. After finishing inference, if any - # of these types changed, start over with the fed-back - # types known from the beginning. - # See issue #3821 (using !typeseq instead of !subtype), - # and issue #7810. - id = var.id+1 - vt = frame.linfo.ssavaluetypes[id] - ot = frame.ssavalue_init[id] - if ot===NF || !(vt⊑ot && ot⊑vt) - frame.ssavalue_init[id] = vt - if get(frame.fedbackvars, var, false) - frame.typegotoredo = true - end - end - frame.fedbackvars[var] = true - end elseif is(hd, :return) pc´ = n + 1 rt = abstract_eval(stmt.args[1], s[pc], frame) @@ -1821,39 +1756,6 @@ function typeinf_frame(frame) end if finished || frame.fixedpoint - if frame.typegotoredo - # if any type_gotos changed, clear state and restart. - frame.typegotoredo = false - for ll = 2:length(s) - s[ll] = () - end - empty!(W) - push!(W, 1) - frame.cur_hand = () - frame.handler_at = Any[ () for i=1:n ] - frame.n_handlers = 0 - frame.linfo.ssavaluetypes[:] = frame.ssavalue_init - @goto restart_typeinf - else - # if a static_typeof was never reached, - # use Union{} as its real type and continue - # running type inference from its uses - # (one of which is the static_typeof) - # TODO: this restart should happen just before calling finish() - for (fbvar, seen) in frame.fedbackvars - if !seen - frame.fedbackvars[fbvar] = true - id = (fbvar::SSAValue).id + 1 - for r in frame.ssavalue_uses[id] - if !is(s[r], ()) # s[r] === () => unreached statement - push!(W, r) - end - end - @goto restart_typeinf - end - end - end - if finished finish(frame) else # fixedpoint propagation @@ -2056,7 +1958,7 @@ function eval_annotate(e::ANY, vtypes::ANY, sv::InferenceState, undefs, pass) e = e::Expr head = e.head - if is(head,:static_typeof) || is(head,:line) || is(head,:const) + if is(head,:line) || is(head,:const) return e elseif is(head,:(=)) e.args[2] = eval_annotate(e.args[2], vtypes, sv, undefs, pass) @@ -2282,9 +2184,6 @@ function effect_free(e::ANY, sv, allow_volatile::Bool) elseif isa(e,Expr) e = e::Expr head = e.head - if head === :static_typeof - return true - end if head === :static_parameter || head === :meta || head === :line || head === :inbounds || head === :boundscheck return true diff --git a/base/range.jl b/base/range.jl index a3badcf109535..335f2d89cb7d1 100644 --- a/base/range.jl +++ b/base/range.jl @@ -382,7 +382,7 @@ maximum(r::AbstractUnitRange) = isempty(r) ? throw(ArgumentError("range must be minimum(r::Range) = isempty(r) ? throw(ArgumentError("range must be non-empty")) : min(first(r), last(r)) maximum(r::Range) = isempty(r) ? throw(ArgumentError("range must be non-empty")) : max(first(r), last(r)) -ctranspose(r::Range) = [x for _=1, x=r] +ctranspose(r::Range) = [x for _=1:1, x=r] transpose(r::Range) = r' # Ranges are immutable diff --git a/base/sparse/sparsematrix.jl b/base/sparse/sparsematrix.jl index 6e18bf43b08ed..4ce6e0e0a4bc4 100644 --- a/base/sparse/sparsematrix.jl +++ b/base/sparse/sparsematrix.jl @@ -3072,8 +3072,8 @@ end function vcat(X::SparseMatrixCSC...) num = length(X) - mX = [ size(x, 1) for x in X ] - nX = [ size(x, 2) for x in X ] + mX = Int[ size(x, 1) for x in X ] + nX = Int[ size(x, 2) for x in X ] m = sum(mX) n = nX[1] @@ -3090,7 +3090,7 @@ function vcat(X::SparseMatrixCSC...) Ti = promote_type(Ti, eltype(X[i].rowval)) end - nnzX = [ nnz(x) for x in X ] + nnzX = Int[ nnz(x) for x in X ] nnz_res = sum(nnzX) colptr = Array{Ti}(n + 1) rowval = Array{Ti}(nnz_res) @@ -3132,8 +3132,8 @@ end function hcat(X::SparseMatrixCSC...) num = length(X) - mX = [ size(x, 1) for x in X ] - nX = [ size(x, 2) for x in X ] + mX = Int[ size(x, 1) for x in X ] + nX = Int[ size(x, 2) for x in X ] m = mX[1] for i = 2 : num if mX[i] != m; throw(DimensionMismatch("")); end @@ -3144,7 +3144,7 @@ function hcat(X::SparseMatrixCSC...) Ti = promote_type(map(x->eltype(x.rowval), X)...) colptr = Array{Ti}(n + 1) - nnzX = [ nnz(x) for x in X ] + nnzX = Int[ nnz(x) for x in X ] nnz_res = sum(nnzX) rowval = Array{Ti}(nnz_res) nzval = Array{Tv}(nnz_res) @@ -3200,8 +3200,8 @@ Concatenate matrices block-diagonally. Currently only implemented for sparse mat """ function blkdiag(X::SparseMatrixCSC...) num = length(X) - mX = [ size(x, 1) for x in X ] - nX = [ size(x, 2) for x in X ] + mX = Int[ size(x, 1) for x in X ] + nX = Int[ size(x, 2) for x in X ] m = sum(mX) n = sum(nX) @@ -3209,7 +3209,7 @@ function blkdiag(X::SparseMatrixCSC...) Ti = promote_type(map(x->eltype(x.rowval), X)...) colptr = Array{Ti}(n + 1) - nnzX = [ nnz(x) for x in X ] + nnzX = Int[ nnz(x) for x in X ] nnz_res = sum(nnzX) rowval = Array{Ti}(nnz_res) nzval = Array{Tv}(nnz_res) @@ -3450,7 +3450,7 @@ function trace{Tv}(A::SparseMatrixCSC{Tv}) s end -diag(A::SparseMatrixCSC) = [d for d in SpDiagIterator(A)] +diag{Tv}(A::SparseMatrixCSC{Tv}) = Tv[d for d in SpDiagIterator(A)] function diagm{Tv,Ti}(v::SparseMatrixCSC{Tv,Ti}) if (size(v,1) != 1 && size(v,2) != 1) diff --git a/src/alloc.c b/src/alloc.c index 545d968512aea..cded29bb6e57f 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -88,13 +88,12 @@ jl_sym_t *body_sym; jl_sym_t *method_sym; jl_sym_t *core_sym; jl_sym_t *enter_sym; jl_sym_t *leave_sym; jl_sym_t *exc_sym; jl_sym_t *error_sym; -jl_sym_t *static_typeof_sym; jl_sym_t *globalref_sym; jl_sym_t *new_sym; jl_sym_t *using_sym; jl_sym_t *const_sym; jl_sym_t *thunk_sym; jl_sym_t *anonymous_sym; jl_sym_t *underscore_sym; jl_sym_t *abstracttype_sym; jl_sym_t *bitstype_sym; -jl_sym_t *compositetype_sym; jl_sym_t *type_goto_sym; +jl_sym_t *compositetype_sym; jl_sym_t *global_sym; jl_sym_t *list_sym; jl_sym_t *dot_sym; jl_sym_t *newvar_sym; jl_sym_t *boundscheck_sym; jl_sym_t *inbounds_sym; diff --git a/src/codegen.cpp b/src/codegen.cpp index a8ff77a17ae83..589a7eb863c48 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -3110,7 +3110,7 @@ static void emit_stmtpos(jl_value_t *expr, jl_codectx_t *ctx) if (jl_is_expr(expr)) { jl_sym_t *head = ((jl_expr_t*)expr)->head; // some expression types are metadata and can be ignored in statement position - if (head == line_sym || head == type_goto_sym || head == meta_sym) + if (head == line_sym || head == meta_sym) return; // fall-through } @@ -3284,18 +3284,6 @@ static jl_cgval_t emit_expr(jl_value_t *expr, jl_codectx_t *ctx) literal_pointer_val(bnd)); } } - else if (head == static_typeof_sym) { - jl_value_t *extype = expr_type((jl_value_t*)ex, ctx); - if (jl_is_type_type(extype)) { - extype = jl_tparam0(extype); - if (jl_is_typevar(extype)) - extype = ((jl_tvar_t*)extype)->ub; - } - else { - extype = (jl_value_t*)jl_any_type; - } - return mark_julia_const(extype); - } else if (head == new_sym) { jl_value_t *ty = expr_type(args[0], ctx); size_t nargs = jl_array_len(ex->args); diff --git a/src/interpreter.c b/src/interpreter.c index 32900f7981f05..c348349962b9d 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -223,9 +223,6 @@ static jl_value_t *eval(jl_value_t *e, interpreter_state *s) else if (ex->head == copyast_sym) { return jl_copy_ast(eval(args[0], s)); } - else if (ex->head == static_typeof_sym) { - return (jl_value_t*)jl_any_type; - } else if (ex->head == exc_sym) { return ptls->exception_in_transit; } @@ -429,7 +426,7 @@ static jl_value_t *eval(jl_value_t *e, interpreter_state *s) jl_throw(args[0]); } else if (ex->head == boundscheck_sym || ex->head == inbounds_sym || ex->head == fastmath_sym || - ex->head == simdloop_sym || ex->head == meta_sym || ex->head == type_goto_sym) { + ex->head == simdloop_sym || ex->head == meta_sym) { return jl_nothing; } jl_errorf("unsupported or misplaced expression %s", jl_symbol_name(ex->head)); diff --git a/src/jltypes.c b/src/jltypes.c index 2739cbe8e8e35..47e1feeed6d64 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -3993,7 +3993,6 @@ void jl_init_types(void) exc_sym = jl_symbol("the_exception"); enter_sym = jl_symbol("enter"); leave_sym = jl_symbol("leave"); - static_typeof_sym = jl_symbol("static_typeof"); new_sym = jl_symbol("new"); const_sym = jl_symbol("const"); global_sym = jl_symbol("global"); @@ -4004,7 +4003,6 @@ void jl_init_types(void) abstracttype_sym = jl_symbol("abstract_type"); bitstype_sym = jl_symbol("bits_type"); compositetype_sym = jl_symbol("composite_type"); - type_goto_sym = jl_symbol("type_goto"); toplevel_sym = jl_symbol("toplevel"); dot_sym = jl_symbol("."); boundscheck_sym = jl_symbol("boundscheck"); diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 168352c1e1f10..9640baef3e3ec 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -1981,78 +1981,29 @@ 'comprehension (lambda (e) - (expand-forms (lower-comprehension #f (cadr e) (cddr e)))) + (if (any (lambda (x) (eq? x ':)) (cddr e)) + (error "comprehension syntax with `:` ranges has been removed")) + (expand-forms `(call (top collect) (generator ,(cadr e) ,@(cddr e))))) 'typed_comprehension (lambda (e) + (if (any (lambda (x) (eq? x ':)) (cdddr e)) + (error "comprehension syntax with `:` ranges has been removed")) (expand-forms (lower-comprehension (cadr e) (caddr e) (cdddr e)))) 'dict_comprehension (lambda (e) (syntax-deprecation #f "[a=>b for (a,b) in c]" "Dict(a=>b for (a,b) in c)") - (expand-forms (lower-dict-comprehension (cadr e) (cddr e)))) + (expand-forms `(call (top Dict) (generator ,(cadr e) ,@(cddr e))))) 'typed_dict_comprehension - (lambda (e) - (expand-forms (lower-typed-dict-comprehension (cadr e) (caddr e) (cdddr e)))))) - -(define (lower-nd-comprehension atype expr ranges) - (let ((result (make-ssavalue)) - (ri (gensy)) - (oneresult (gensy))) - ;; evaluate one expression to figure out type and size - ;; compute just one value by inserting a break inside loops - (define (evaluate-one ranges) - (if (null? ranges) - `(= ,oneresult ,expr) - (if (eq? (car ranges) `:) - (evaluate-one (cdr ranges)) - `(for ,(car ranges) - (block ,(evaluate-one (cdr ranges)) - (break)) )))) - - ;; compute the dimensions of the result - (define (compute-dims ranges oneresult-dim) - (if (null? ranges) - (list) - (if (eq? (car ranges) `:) - (cons `(call (top size) ,oneresult ,oneresult-dim) - (compute-dims (cdr ranges) (+ oneresult-dim 1))) - (cons `(call (top length) ,(caddr (car ranges))) - (compute-dims (cdr ranges) oneresult-dim)) ))) - - ;; construct loops to cycle over all dimensions of an n-d comprehension - (define (construct-loops ranges iters oneresult-dim) - (if (null? ranges) - (if (null? iters) - `(block (call (top setindex!) ,result ,expr ,ri) - (= ,ri (call (top +) ,ri) 1)) - `(block (call (top setindex!) ,result (ref ,expr ,@(reverse iters)) ,ri) - (= ,ri (call (top +) ,ri 1))) ) - (if (eq? (car ranges) `:) - (let ((i (make-ssavalue))) - `(for (= ,i (: 1 (call (top size) ,oneresult ,oneresult-dim))) - ,(construct-loops (cdr ranges) (cons i iters) (+ oneresult-dim 1)) )) - `(for ,(car ranges) - ,(construct-loops (cdr ranges) iters oneresult-dim) )))) - - ;; Evaluate the comprehension - `(scope-block - (block - (local ,oneresult) - ,(evaluate-one ranges) - (= ,result (call (core Array) ,(if atype atype `(call (top eltype) ,oneresult)) - ,@(compute-dims ranges 1))) - (= ,ri 1) - ,(construct-loops (reverse ranges) (list) 1) - ,result )))) + (lambda (e) (expand-forms + `(call (call (core apply_type) (top Dict) ,@(cdr (cadr e))) + (generator ,(caddr e) ,@(cdddr e))))))) (define (lower-comprehension atype expr ranges) - (if (any (lambda (x) (eq? x ':)) ranges) - (lower-nd-comprehension atype expr ranges) (let ((result (make-ssavalue)) (ri (gensy)) - (initlabl (if atype #f (make-ssavalue))) (oneresult (make-ssavalue)) (lengths (map (lambda (x) (make-ssavalue)) ranges)) (states (map (lambda (x) (gensy)) ranges)) @@ -2063,7 +2014,6 @@ (define (construct-loops ranges rv is states lengths) (if (null? ranges) `(block (= ,oneresult ,expr) - ,@(if atype '() `((type_goto ,initlabl ,oneresult))) (inbounds true) (call (top setindex!) ,result ,oneresult ,ri) (inbounds pop) @@ -2089,79 +2039,10 @@ ,.(map (lambda (v r) `(= ,v (call (top length) ,r))) lengths rv) (scope-block (block - ,@(if atype '() `((label ,initlabl))) - (= ,result (call (core Array) - ,(if atype atype `(static_typeof ,oneresult)) - ,@lengths)) + (= ,result (call (core Array) ,atype ,@lengths)) (= ,ri 1) ,(construct-loops (reverse ranges) (reverse rv) is states (reverse lengths)) - ,result)))))) - -(define (lower-dict-comprehension expr ranges) - (let ((result (make-ssavalue)) - (initlabl (make-ssavalue)) - (onekey (make-ssavalue)) - (oneval (make-ssavalue)) - (rv (map (lambda (x) (make-ssavalue)) ranges))) - - ;; construct loops to cycle over all dimensions of an n-d comprehension - (define (construct-loops ranges) - (if (null? ranges) - `(block (= ,onekey ,(cadr expr)) - (= ,oneval ,(caddr expr)) - (type_goto ,initlabl ,onekey ,oneval) - (call (top setindex!) ,result ,oneval ,onekey)) - `(for ,(car ranges) - (block - ;; *** either this or force all for loop vars local - ,.(map (lambda (r) `(local ,r)) - (lhs-vars (cadr (car ranges)))) - ,(construct-loops (cdr ranges)))))) - - ;; Evaluate the comprehension - (let ((loopranges - (map (lambda (r v) `(= ,(cadr r) ,v)) ranges rv))) - `(block - ,.(map (lambda (v r) `(= ,v ,(caddr r))) rv ranges) - (scope-block - (block - #;,@(map (lambda (r) `(local ,r)) - (apply append (map (lambda (r) (lhs-vars (cadr r))) ranges))) - (label ,initlabl) - (= ,result (call (curly (top Dict) - (static_typeof ,onekey) - (static_typeof ,oneval)))) - ,(construct-loops (reverse loopranges)) - ,result)))))) - -(define (lower-typed-dict-comprehension atypes expr ranges) - (if (not (and (length= atypes 3) - (eq? (car atypes) '=>))) - (error "invalid \"typed_dict_comprehension\" syntax") - (let ( (result (make-ssavalue)) - (rs (map (lambda (x) (make-ssavalue)) ranges)) ) - - ;; construct loops to cycle over all dimensions of an n-d comprehension - (define (construct-loops ranges rs) - (if (null? ranges) - `(call (top setindex!) ,result ,(caddr expr) ,(cadr expr)) - `(for (= ,(cadr (car ranges)) ,(car rs)) - (block - ;; *** either this or force all for loop vars local - ,.(map (lambda (r) `(local ,r)) - (lhs-vars (cadr (car ranges)))) - ,(construct-loops (cdr ranges) (cdr rs)))))) - - ;; Evaluate the comprehension - `(block - ,.(map make-assignment rs (map caddr ranges)) - (= ,result (call (curly (top Dict) ,(cadr atypes) ,(caddr atypes)))) - (scope-block - (block - #;,@(map (lambda (r) `(local ,r)) - (apply append (map (lambda (r) (lhs-vars (cadr r))) ranges))) - ,(construct-loops (reverse ranges) (reverse rs)) - ,result)))))) + ,result))))) (define (lhs-vars e) (cond ((symbol? e) (list e)) @@ -3141,17 +3022,6 @@ f(x) = yt(x) (cons (list code handler-level (cadr e)) handler-goto-fixups)) '(null))) - ((type_goto) - (let ((m (get label-map (cadr e) #f))) - (if m - (emit `(type_goto ,m ,@(cddr e))) - (let ((l (make-label))) - (put! label-map (cadr e) l) - (emit `(type_goto ,l ,@(cddr e))))))) - ((static_typeof) - (assert (and value (not tail))) - e) - ;; exception handlers are lowered using ;; (enter L) - push handler with catch block at label L ;; (leave n) - pop N exception handlers diff --git a/src/julia.h b/src/julia.h index ef280e0a896fc..808e30570c0c4 100644 --- a/src/julia.h +++ b/src/julia.h @@ -570,11 +570,11 @@ extern jl_sym_t *body_sym; extern jl_sym_t *method_sym; extern jl_sym_t *slot_sym; extern jl_sym_t *enter_sym; extern jl_sym_t *leave_sym; extern jl_sym_t *exc_sym; extern jl_sym_t *new_sym; -extern jl_sym_t *static_typeof_sym; extern jl_sym_t *compiler_temp_sym; +extern jl_sym_t *compiler_temp_sym; extern jl_sym_t *const_sym; extern jl_sym_t *thunk_sym; extern jl_sym_t *anonymous_sym; extern jl_sym_t *underscore_sym; extern jl_sym_t *abstracttype_sym; extern jl_sym_t *bitstype_sym; -extern jl_sym_t *compositetype_sym; extern jl_sym_t *type_goto_sym; +extern jl_sym_t *compositetype_sym; extern jl_sym_t *global_sym; extern jl_sym_t *unused_sym; extern jl_sym_t *boundscheck_sym; extern jl_sym_t *inbounds_sym; extern jl_sym_t *copyast_sym; extern jl_sym_t *fastmath_sym; diff --git a/src/toplevel.c b/src/toplevel.c index 4ea1cb8972a8c..23db71a5e0fb6 100644 --- a/src/toplevel.c +++ b/src/toplevel.c @@ -269,8 +269,6 @@ int jl_has_intrinsics(jl_lambda_info_t *li, jl_value_t *v, jl_module_t *m) jl_expr_t *e = (jl_expr_t*)v; if (jl_array_len(e->args) == 0) return 0; - if (e->head == static_typeof_sym) - return 1; if (e->head == toplevel_sym || e->head == copyast_sym) return 0; jl_value_t *e0 = jl_exprarg(e, 0); diff --git a/test/arrayops.jl b/test/arrayops.jl index c7e0356e00b37..29377c403b5a2 100644 --- a/test/arrayops.jl +++ b/test/arrayops.jl @@ -983,7 +983,7 @@ X = [ i+2j for i=1:5, j=1:5 ] @test X[2,3] == 8 @test X[4,5] == 14 @test isequal(ones(2,3) * ones(2,3)', [3. 3.; 3. 3.]) -@test isequal([ [1,2] for i=1:2, : ], [1 2; 1 2]) +# @test isequal([ [1,2] for i=1:2, : ], [1 2; 1 2]) # where element type is a Union. try to confuse type inference. foo32_64(x) = (x<2) ? Int32(x) : Int64(x) boo32_64() = [ foo32_64(i) for i=1:2 ] diff --git a/test/dict.jl b/test/dict.jl index c0cde55fcee63..45dcbbe998c8d 100644 --- a/test/dict.jl +++ b/test/dict.jl @@ -98,7 +98,7 @@ let end _d = Dict("a"=>0) -@test isa([k for k in filter(x->length(x)==1, collect(keys(_d)))], Vector{Any}) +@test isa([k for k in filter(x->length(x)==1, collect(keys(_d)))], Vector{String}) let d = Dict(((1, 2), (3, 4)))