vert-x3 / vertx-rx

Reactive Extensions for Vert.x
Apache License 2.0
147 stars 73 forks source link

Passing null instead of parameter #71

Closed cescoffier closed 7 years ago

cescoffier commented 7 years ago

When a method passes a Class parameter, the RX generated class passes null to the delegated method:

If you have this method:

<T> T dumb(Class<T> tClass);

It generates:

public <T> T dumb(Class<T> tClass) { 
    T ret = (T) delegate.dumb(null);
    return ret;
  }

As you can imagine it's a bit annoying...

The culprit is: vertx-rxjava/template/common.templ line 125:

...
    return 'null';
}

Instead of

    return expr;
}

This bug is blocking https://github.com/vert-x3/vertx-service-discovery/issues/14.

vietj commented 7 years ago

looks easy to fix :-)

cescoffier commented 7 years ago

Yes, I've opened the issue because I wonder if we need to add a test in the CodeGen TCK or just in RX?

It works in JavaScript.

vietj commented 7 years ago

I think the method exists in TCK, but the TCK coverage in Rx is incomplete.