I'm running the code form the java support learning page and get an exception when I try to build it. Here are the steps I did:
- Generate bindings:
ballerina bindgen -o src/test java.io.FileInputStream java.io.InputStream --public
- Copy sample code
import ballerina/java;
type FileInputStreamTypedesc typedesc<FileInputStream>;
function test(){
InputStream inputStream = check newFileInputStream3("sample.txt");
FileInputStream fileInputStream = <FileInputStream>check java:cast(inputStream, FileInputStreamTypedesc);
}
- build
ballerina build test
Compiling source
acme/test:0.0.1
error: acme/test:0.0.1::main.bal:7:85: incompatible types: expected 'typedesc<ballerina/java:JObject>', found 'typedesc<typedesc<acme/test:0.0.1:FileInputStream>>'
used versions:
- jBallerina 1.2.13
- Language specification 2020R1
- Update Tool 0.8.10
Thanks for any help in advance!