uqbar-project / wollok

Wollok Programming Language
GNU General Public License v3.0
60 stars 16 forks source link

Stack trace caused by exception raised within a closure is not clear enough #578

Closed matifreyre closed 8 years ago

matifreyre commented 8 years ago

This code raises an exception due to "link" not having a weapon (variable arma is null), which is used within the method atacarA:

#{1}.forEach({each => link.atacarA(captainFalcon)})

The stack trace obtained from the exception is the following:

wollok.lang.Exception: Error while calling native method 'public java.lang.Object wollok.lang.WCollection.fold(org.uqbar.project.wollok.interpreter.core.WollokObject,org.uqbar.project.wollok.interpreter.core.WollokObject) with parameters: [Ljava.lang.Object;@1f1cddf3
    at wollok.lang.Set.fold(initialValue,closure) [classpath:/wollok.wlk]
    at wollok.lang.Collection.forEach(closure) [classpath:/wollok.wlk]
    at  [file:/C:/Users/MFREYRE/Downloads/wollok-win32.win32.x86_64/workspace/Wollok-Free-Samples/src/smashBros/ejercicio6Tests.wtest]
Caused by: wollok.lang.Exception: Error evaluating line file:/C:/Users/MFREYRE/Downloads/wollok-win32.win32.x86_64/workspace/Wollok-Free-Samples/src/smashBros/ejercicio6Tests.wtest:[92]: link.atacarA(captainFalcon)
    at wollok.lang.Closure.apply(parameters) [classpath:/wollok.wlk]
    at wollok.lang.Collection.forEach(closure) [classpath:/wollok.wlk]
    at wollok.lang.Set.fold(initialValue,closure) [classpath:/wollok.wlk]
    at wollok.lang.Collection.forEach(closure) [classpath:/wollok.wlk]
    at  [file:/C:/Users/MFREYRE/Downloads/wollok-win32.win32.x86_64/workspace/Wollok-Free-Samples/src/smashBros/ejercicio6Tests.wtest]

As it can be seen, the stack trace only informs that the closure could not be evaluated, but not why.

If I simply write the content of the closure instead (link.atacarA(captainFalcon)), the stack trace changes. It can be seen that the problem is a java.lang.NullPointerException caused by arma.poderPara(this):

org.uqbar.project.wollok.interpreter.WollokInterpreterException: Error evaluating line file:/C:/Users/MFREYRE/Downloads/wollok-win32.win32.x86_64/workspace/Wollok-Free-Samples/src/smashBros/ejercicio6Tests.wtest:[92]: link.atacarA(captainFalcon)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:248)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.eval(WollokInterpreterEvaluator.java:130)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator$1.apply(WollokInterpreterEvaluator.java:137)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator$1.apply(WollokInterpreterEvaluator.java:1)
    at org.eclipse.xtext.xbase.lib.IteratorExtensions.fold(IteratorExtensions.java:627)
    at org.eclipse.xtext.xbase.lib.IterableExtensions.fold(IterableExtensions.java:536)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evalAll(WollokInterpreterEvaluator.java:140)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator._evaluate(WollokLauncherInterpreterEvaluator.java:112)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.evaluate(WollokLauncherInterpreterEvaluator.java:216)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evaluate(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:236)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.eval(WollokInterpreterEvaluator.java:130)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.access$0(WollokLauncherInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator$1.apply(WollokLauncherInterpreterEvaluator.java:83)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator$1.apply(WollokLauncherInterpreterEvaluator.java:1)
    at org.eclipse.xtext.xbase.lib.IteratorExtensions.fold(IteratorExtensions.java:627)
    at org.eclipse.xtext.xbase.lib.IterableExtensions.fold(IterableExtensions.java:536)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator._evaluate(WollokLauncherInterpreterEvaluator.java:88)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.evaluate(WollokLauncherInterpreterEvaluator.java:212)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evaluate(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.interpret(WollokInterpreter.java:149)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.interpret(WollokInterpreter.java:123)
    at org.uqbar.project.wollok.launch.WollokLauncher.doSomething(WollokLauncher.java:43)
    at org.uqbar.project.wollok.launch.WollokChecker.doMain(WollokChecker.java:83)
    at org.uqbar.project.wollok.launch.WollokLauncher.main(WollokLauncher.java:31)
Caused by: org.uqbar.project.wollok.interpreter.WollokInterpreterException: Error evaluating line file:/C:/Users/MFREYRE/Downloads/wollok-win32.win32.x86_64/workspace/Wollok-Free-Samples/src/smashBros/ejercicio6.wlk:[40]: {
            super(otro) 
            arma.atacaste()
        }
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:248)
    at org.uqbar.project.wollok.interpreter.AbstractWollokCallable.eval(AbstractWollokCallable.java:133)
    at org.uqbar.project.wollok.interpreter.AbstractWollokCallable$1.apply(AbstractWollokCallable.java:88)
    at org.uqbar.project.wollok.interpreter.AbstractWollokCallable$1.apply(AbstractWollokCallable.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.performOnStack(WollokInterpreter.java:193)
    at org.uqbar.project.wollok.interpreter.AbstractWollokCallable.call(AbstractWollokCallable.java:101)
    at org.uqbar.project.wollok.interpreter.core.WollokObject.call(WollokObject.java:113)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator._evaluate(WollokInterpreterEvaluator.java:758)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.evaluate(WollokLauncherInterpreterEvaluator.java:210)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evaluate(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:236)
    ... 24 more
Caused by: org.uqbar.project.wollok.interpreter.WollokInterpreterException: Error evaluating line file:/C:/Users/MFREYRE/Downloads/wollok-win32.win32.x86_64/workspace/Wollok-Free-Samples/src/smashBros/ejercicio6.wlk:[41]: super(otro)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:248)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.eval(WollokInterpreterEvaluator.java:130)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator$1.apply(WollokInterpreterEvaluator.java:137)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator$1.apply(WollokInterpreterEvaluator.java:1)
    at org.eclipse.xtext.xbase.lib.IteratorExtensions.fold(IteratorExtensions.java:627)
    at org.eclipse.xtext.xbase.lib.IterableExtensions.fold(IterableExtensions.java:536)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evalAll(WollokInterpreterEvaluator.java:140)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator._evaluate(WollokInterpreterEvaluator.java:652)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.evaluate(WollokLauncherInterpreterEvaluator.java:170)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evaluate(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:236)
    ... 34 more
Caused by: org.uqbar.project.wollok.interpreter.WollokInterpreterException: Error evaluating line file:/C:/Users/MFREYRE/Downloads/wollok-win32.win32.x86_64/workspace/Wollok-Free-Samples/src/smashBros/ejercicio6.wlk:[10]: {
            otro.recibirAtaqueDe(this.potencialOfensivo())
        }
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:248)
    at org.uqbar.project.wollok.interpreter.AbstractWollokCallable.eval(AbstractWollokCallable.java:133)
    at org.uqbar.project.wollok.interpreter.AbstractWollokCallable$1.apply(AbstractWollokCallable.java:88)
    at org.uqbar.project.wollok.interpreter.AbstractWollokCallable$1.apply(AbstractWollokCallable.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.performOnStack(WollokInterpreter.java:193)
    at org.uqbar.project.wollok.interpreter.AbstractWollokCallable.call(AbstractWollokCallable.java:101)
    at org.uqbar.project.wollok.interpreter.core.CallableSuper.call(CallableSuper.java:40)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator._evaluate(WollokInterpreterEvaluator.java:758)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.evaluate(WollokLauncherInterpreterEvaluator.java:210)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evaluate(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:236)
    ... 44 more
Caused by: org.uqbar.project.wollok.interpreter.WollokInterpreterException: Error evaluating line file:/C:/Users/MFREYRE/Downloads/wollok-win32.win32.x86_64/workspace/Wollok-Free-Samples/src/smashBros/ejercicio6.wlk:[11]: otro.recibirAtaqueDe(this.potencialOfensivo())
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:248)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.eval(WollokInterpreterEvaluator.java:130)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator$1.apply(WollokInterpreterEvaluator.java:137)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator$1.apply(WollokInterpreterEvaluator.java:1)
    at org.eclipse.xtext.xbase.lib.IteratorExtensions.fold(IteratorExtensions.java:627)
    at org.eclipse.xtext.xbase.lib.IterableExtensions.fold(IterableExtensions.java:536)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evalAll(WollokInterpreterEvaluator.java:140)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator._evaluate(WollokInterpreterEvaluator.java:652)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.evaluate(WollokLauncherInterpreterEvaluator.java:170)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evaluate(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:236)
    ... 54 more
Caused by: org.uqbar.project.wollok.interpreter.WollokInterpreterException: Error evaluating line file:/C:/Users/MFREYRE/Downloads/wollok-win32.win32.x86_64/workspace/Wollok-Free-Samples/src/smashBros/ejercicio6.wlk:[11]: this.potencialOfensivo()
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:248)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.eval(WollokInterpreterEvaluator.java:130)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator$2.apply(WollokInterpreterEvaluator.java:147)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator$2.apply(WollokInterpreterEvaluator.java:1)
    at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
    at com.google.common.collect.Lists$TransformingRandomAccessList.get(Lists.java:572)
    at java.util.AbstractList$Itr.next(Unknown Source)
    at java.util.AbstractCollection.toArray(Unknown Source)
    at com.google.common.collect.Iterables.toArray(Iterables.java:314)
    at org.eclipse.xtext.xbase.lib.Conversions.unwrapArray(Conversions.java:96)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evalEach(WollokInterpreterEvaluator.java:150)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator._evaluate(WollokInterpreterEvaluator.java:757)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.evaluate(WollokLauncherInterpreterEvaluator.java:210)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evaluate(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:236)
    ... 64 more
Caused by: org.uqbar.project.wollok.interpreter.WollokInterpreterException: Error evaluating line file:/C:/Users/MFREYRE/Downloads/wollok-win32.win32.x86_64/workspace/Wollok-Free-Samples/src/smashBros/ejercicio6.wlk:[37]: {
            return poderBase + arma.poderPara(this)
        }
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:248)
    at org.uqbar.project.wollok.interpreter.AbstractWollokCallable.eval(AbstractWollokCallable.java:133)
    at org.uqbar.project.wollok.interpreter.AbstractWollokCallable$1.apply(AbstractWollokCallable.java:88)
    at org.uqbar.project.wollok.interpreter.AbstractWollokCallable$1.apply(AbstractWollokCallable.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.performOnStack(WollokInterpreter.java:193)
    at org.uqbar.project.wollok.interpreter.AbstractWollokCallable.call(AbstractWollokCallable.java:101)
    at org.uqbar.project.wollok.interpreter.core.WollokObject.call(WollokObject.java:113)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator._evaluate(WollokInterpreterEvaluator.java:758)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.evaluate(WollokLauncherInterpreterEvaluator.java:210)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evaluate(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:236)
    ... 78 more
Caused by: org.uqbar.project.wollok.interpreter.WollokInterpreterException: Error evaluating line file:/C:/Users/MFREYRE/Downloads/wollok-win32.win32.x86_64/workspace/Wollok-Free-Samples/src/smashBros/ejercicio6.wlk:[38]: return poderBase + arma.poderPara(this)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:248)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.eval(WollokInterpreterEvaluator.java:130)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator$1.apply(WollokInterpreterEvaluator.java:137)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator$1.apply(WollokInterpreterEvaluator.java:1)
    at org.eclipse.xtext.xbase.lib.IteratorExtensions.fold(IteratorExtensions.java:627)
    at org.eclipse.xtext.xbase.lib.IterableExtensions.fold(IterableExtensions.java:536)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evalAll(WollokInterpreterEvaluator.java:140)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator._evaluate(WollokInterpreterEvaluator.java:652)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.evaluate(WollokLauncherInterpreterEvaluator.java:170)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evaluate(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:236)
    ... 88 more
Caused by: org.uqbar.project.wollok.interpreter.WollokInterpreterException: Error evaluating line file:/C:/Users/MFREYRE/Downloads/wollok-win32.win32.x86_64/workspace/Wollok-Free-Samples/src/smashBros/ejercicio6.wlk:[38]: poderBase + arma.poderPara(this)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:248)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.eval(WollokInterpreterEvaluator.java:130)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator._evaluate(WollokInterpreterEvaluator.java:487)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.evaluate(WollokLauncherInterpreterEvaluator.java:190)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evaluate(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:236)
    ... 98 more
Caused by: org.uqbar.project.wollok.interpreter.WollokRuntimeException: Error while resolving 100 + org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator$11@37e69c43
    at org.uqbar.project.wollok.interpreter.operation.WollokDeclarativeNativeBasicOperations$2.apply(WollokDeclarativeNativeBasicOperations.java:79)
    at org.uqbar.project.wollok.interpreter.operation.WollokDeclarativeNativeBasicOperations$2.apply(WollokDeclarativeNativeBasicOperations.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator._evaluate(WollokInterpreterEvaluator.java:691)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.evaluate(WollokLauncherInterpreterEvaluator.java:168)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evaluate(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:236)
    ... 103 more
Caused by: org.uqbar.project.wollok.interpreter.WollokInterpreterException: Error evaluating line file:/C:/Users/MFREYRE/Downloads/wollok-win32.win32.x86_64/workspace/Wollok-Free-Samples/src/smashBros/ejercicio6.wlk:[38]: arma.poderPara(this)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:248)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.eval(WollokInterpreterEvaluator.java:130)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator$11.apply(WollokInterpreterEvaluator.java:701)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator$11.apply(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.operation.WollokDeclarativeNativeBasicOperations.sumOperation(WollokDeclarativeNativeBasicOperations.java:125)
    at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.uqbar.project.wollok.interpreter.operation.WollokDeclarativeNativeBasicOperations$2.apply(WollokDeclarativeNativeBasicOperations.java:62)
    ... 108 more
Caused by: java.lang.NullPointerException
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator._evaluate(WollokInterpreterEvaluator.java:758)
    at org.uqbar.project.wollok.launch.WollokLauncherInterpreterEvaluator.evaluate(WollokLauncherInterpreterEvaluator.java:210)
    at org.uqbar.project.wollok.interpreter.WollokInterpreterEvaluator.evaluate(WollokInterpreterEvaluator.java:1)
    at org.uqbar.project.wollok.interpreter.WollokInterpreter.eval(WollokInterpreter.java:236)
    ... 116 more
matifreyre commented 8 years ago

I just edited the previous comment: the closure in the first piece of code should have a parameter. The issue remains valid, though.

javierfernandes commented 8 years ago

Cool. This kind of bad cause reporting for errors are priority.

npasserini commented 8 years ago

+1

On Thu, Jan 7, 2016 at 3:48 PM, javierfernandes notifications@github.com wrote:

Cool. This kind of bad cause reporting for errors are priority.

— Reply to this email directly or view it on GitHub https://github.com/uqbar-project/wollok/issues/578#issuecomment-169770710 .

javierfernandes commented 8 years ago

Ok. So, there are two problems here. The underlying cause of both problems is indeed a null pointer. When trying to send a message to something that evaluates to "null". Eventually we might want to analyse the change to model "null" as a wollok object. I just didn't want to get into that change, because it affects many places.

So, in the first case it is showing a "wollok exception", that's good. We always want to see that kind fo stack trace and not the java stack trace as it is the case in the second example.

The problem with the first case is that the wollok stack trace doesn't include the real cause: you cannot send a message to null. So I have improved that. Now this test


object link {
    var arma
    method atacarA(alguien) {
        arma.causarDanio(alguien)
    }
}

object captainFalcon {}

test "testX" {
    #{ 1 }.forEach({ each => link.atacarA(captainFalcon) })
}

Fails like this

wollok.lang.Exception: Error while calling native method 'WCollection.fold(WollokObject, WollokObject) with parameters: null, aClosure(acc, e)
    at wollok.lang.Set.fold(initialValue,closure) [/wollok.wlk:365]
    at wollok.lang.Collection.forEach(closure) [/wollok.wlk:231]
    at  [/nullpointer.wtest:13]
Caused by: wollok.lang.Exception: Error while calling native method 'Closure.doApply(WollokObject[]) with parameters: [Lorg.uqbar.project.wollok.interpreter.core.WollokObject;@5d1e09bc
    at wollok.lang.Closure.apply(parameters) [/wollok.wlk:604]
    at wollok.lang.Collection.forEach(closure) [/wollok.wlk:231]
    at wollok.lang.Set.fold(initialValue,closure) [/wollok.wlk:365]
    at wollok.lang.Collection.forEach(closure) [/wollok.wlk:231]
    at  [/nullpointer.wtest:13]
Caused by: wollok.lang.Exception: Cannot send message causarDanio(alguien) to null
    at nullpointer.link.atacarA(alguien) [/nullpointer.wtest:5]
    at  [/nullpointer.wtest:9]
    at wollok.lang.Closure.apply(parameters) [/wollok.wlk:604]
    at wollok.lang.Collection.forEach(closure) [/wollok.wlk:231]
    at wollok.lang.Set.fold(initialValue,closure) [/wollok.wlk:365]
    at wollok.lang.Collection.forEach(closure) [/wollok.wlk:231]
    at  [/nullpointer.wtest:13]

I wonder if we can just remove the intermediate exceptions being automatically generated for native methods. But I'm afraid we will lose information for other exceptions.

Now as the NPE triggers a wollok exception throwing (and not java) the second case got solved

test "testX" {
    link.atacarA(captainFalcon)
}

Causes

wollok.lang.Exception: Cannot send message causarDanio(alguien) to null
    at nullpointer.link.atacarA(alguien) [/nullpointer.wtest:5]
    at  [/nullpointer.wtest:9]