ceylon / ceylon-js

DEPRECATED
Apache License 2.0
54 stars 9 forks source link

NPE compiling the SDK #507

Closed jvasileff closed 9 years ago

jvasileff commented 9 years ago

In line: https://github.com/ceylon/ceylon-js/blob/91387ce6a4543aa9e2126716dd05568d3dde75ab/src/main/java/com/redhat/ceylon/compiler/js/BmeGenerator.java#L65

Possibly related to changes for https://github.com/ceylon/ceylon-spec/issues/1224

compile-js:
   [delete] Deleting directory /Users/jvasileff/Dropbox/Repos/ceylon/ceylon-sdk/build/source-promise-js
    [mkdir] Created dir: /Users/jvasileff/Dropbox/Repos/ceylon/ceylon-sdk/build/source-promise-js
     [copy] Copying 15 files to /Users/jvasileff/Dropbox/Repos/ceylon/ceylon-sdk/build/source-promise-js/ceylon/promise
[ceylon-compile-js] Error: Errors found. Compilation stopped.
[ceylon-compile-js] Note: Created module ceylon.promise/1.1.1
[ceylon-compile-js] error encountered [GenerateJsVisitor caused an exception visiting InvocationExpression node: java.lang.NullPointerException at com.redhat.ceylon.compiler.js.BmeGenerator.hasTypeParameters(BmeGenerator.java:65)] at 90:28-90:34 of Deferred.ceylon
[ceylon-compile-js] error encountered [GenerateJsVisitor caused an exception visiting InvocationExpression node: java.lang.NullPointerException at com.redhat.ceylon.compiler.js.BmeGenerator.hasTypeParameters(BmeGenerator.java:65)] at 60:26-60:32 of Deferred.ceylon
[ceylon-compile-js] ceylon compile-js: 2 errors.
lucaswerkmeister commented 9 years ago

At this and this line in Deferred.ceylon.

lucaswerkmeister commented 9 years ago

Can also reproduced with this code.

lucaswerkmeister commented 9 years ago

Apparently the bug just occurs any time you call a parameter with functional type. However, if the parameter is declared as Result on(T val) instead of Result(T) on (i. e., an actual functional parameter), it works.

lucaswerkmeister commented 9 years ago

Correction: doesn’t need to be a parameter. As far as I can tell, no expression of callable type can be called at all.

chochos commented 9 years ago

this has been fixed but I didn't notice the issue until now.