~ubuntu-branches/ubuntu/wily/julia/wily

« back to all changes in this revision

Viewing changes to src/builtins.c

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot
  • Date: 2013-11-17 19:32:52 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20131117193252-tkrpclguqqebqa35
Tags: 0.2.0+dfsg-3
testsuite-i386.patch: loosen the numerical precision for yet another test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
302
302
 
303
303
#include "newobj_internal.h"
304
304
 
 
305
void jl_add_constructors(jl_datatype_t *t);
 
306
 
305
307
JL_CALLABLE(jl_f_kwcall)
306
308
{
307
309
    if (nargs < 3)
308
 
        jl_error("internal error: malformed named argument call");
 
310
        jl_error("internal error: malformed keyword argument call");
309
311
    JL_TYPECHK(apply, function, args[0]);
310
312
    jl_function_t *f = (jl_function_t*)args[0];
 
313
    if (f->fptr == jl_f_ctor_trampoline)
 
314
        jl_add_constructors((jl_datatype_t*)f);
311
315
    if (!jl_is_gf(f))
312
 
        jl_error("function does not accept named arguments");
 
316
        jl_error("function does not accept keyword arguments");
313
317
    jl_function_t *sorter = ((jl_methtable_t*)f->env)->kwsorter;
314
318
    if (sorter == NULL) {
315
 
        jl_errorf("function %s does not accept named arguments",
 
319
        jl_errorf("function %s does not accept keyword arguments",
316
320
                  jl_gf_name(f)->name);
317
321
    }
318
322
 
801
805
    jl_function_t *f = (jl_function_t*)F;
802
806
    assert(f->linfo != NULL);
803
807
    // to run inference on all thunks. slows down loading files.
 
808
    // NOTE: if this call to inference is removed, type_annotate in inference.jl
 
809
    // needs to be updated to infer inner functions.
804
810
    if (f->linfo->inferred == 0) {
805
811
        if (!jl_in_inference) {
806
812
            if (!jl_is_expr(f->linfo->ast)) {