test for interface calls

This commit is contained in:
Volker Berlin 2020-01-26 14:29:27 +01:00
parent 800edc837d
commit 674eb84129
2 changed files with 17 additions and 1 deletions

View File

@ -58,6 +58,6 @@ class WasmCallInterfaceInstruction extends WasmCallInstruction {
* {@inheritDoc} * {@inheritDoc}
*/ */
public void writeTo( @Nonnull ModuleWriter writer ) throws IOException { public void writeTo( @Nonnull ModuleWriter writer ) throws IOException {
throw new WasmException( "Interface calls not supported", getLineNumber() ); throw new WasmException( "Interface calls are not supported.", getLineNumber() );
} }
} }

View File

@ -19,7 +19,9 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -111,4 +113,18 @@ public class RuntimeErrors {
run.run(); run.run();
} }
} }
@Test
public void interfaceCall() throws IOException {
compileErrorTest( "Interface calls are not supported.", InterfaceMethod.class );
}
static class InterfaceMethod {
@Export
static int runnable() {
List list = new ArrayList();
return list.size();
}
}
} }