~zorba-coders/zorba/binary_serialization

« back to all changes in this revision

Viewing changes to src/compiler/translator/translator.cpp

  • Committer: Gabriel Petrovay
  • Date: 2011-11-29 12:44:04 UTC
  • mfrom: (10553.1.4 zorba)
  • Revision ID: gabipetrovay@gmail.com-20111129124404-twfu6kw1poy2czgw
merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
3152
3152
    if (params == NULL)
3153
3153
      params = new ParamList(loc);
3154
3154
 
3155
 
    ulong numParams = (ulong)params->size();
 
3155
    csize numParams = params->size();
3156
3156
 
3157
3157
    std::vector<xqtref_t> paramTypes;
3158
3158
 
3188
3188
      // have an updating expr as input to a treat expr, which is not allowed
3189
3189
      // yet.
3190
3190
      //returnType = theRTM.EMPTY_TYPE;
3191
 
 
3192
 
      // TODO: remove this
3193
 
      if (func_decl->is_external())
3194
 
      {
3195
 
        returnType = theRTM.EMPTY_TYPE;
3196
 
      }
3197
3191
    }
3198
3192
 
3199
3193
    // Create the function signature.
3226
3220
      if (f.getp() != 0)
3227
3221
      {
3228
3222
        // We make sure that the types of the parameters and the return type
3229
 
        // are equal to the one that is declared in the module
 
3223
        // are subtypes of the ones declared in the module
3230
3224
        const signature& s = f->getSignature();
3231
 
        if (!sig.equals(tm, s))
 
3225
        if (!s.subtype(tm, sig, loc))
3232
3226
        {
3233
3227
          RAISE_ERROR(zerr::ZXQP0007_FUNCTION_SIGNATURE_NOT_EQUAL, loc,
3234
3228
          ERROR_PARAMS(BUILD_STRING('{',
3367
3361
 
3368
3362
  const zstring& fname = v.get_name()->get_qname();
3369
3363
 
3370
 
  ulong numParams = v.get_param_count();
 
3364
  csize numParams = v.get_param_count();
3371
3365
 
3372
3366
  function* lFunc = lookup_fn(v.get_name(), numParams, loc);
3373
3367
 
3452
3446
      rchandle<flwor_expr> flwor = pop_nodestack().dyn_cast<flwor_expr>();
3453
3447
      ZORBA_ASSERT(flwor != NULL);
3454
3448
 
3455
 
      for (ulong i = 0; i < numParams; ++i)
 
3449
      for (csize i = 0; i < numParams; ++i)
3456
3450
      {
3457
3451
        const let_clause* lc = dynamic_cast<const let_clause*>((*flwor)[i]);
3458
3452
        var_expr* argVar = dynamic_cast<var_expr*>(lc->get_expr());