ballerina-platform / ballerina-lang

The Ballerina Programming Language
https://ballerina.io/
Apache License 2.0
3.54k stars 733 forks source link

[Bug]: Bindgen tool generates incorrect code #42624

Closed hasithaa closed 2 weeks ago

hasithaa commented 3 weeks ago

Description

Bindgen tool generates a code with compilation errors.

Steps to Reproduce

  1. Create a project
  2. Inside the project execute bal bindgen -mvn com.github.jknack:handlebars:4.3.1 --public com.github.jknack.handlebars.Handlebars com.github.jknack.handlebars.Template
  3. Compiler the project.
Compiling source
        hasitha/test:0.1.0
ERROR [modules/com.github.jknack.handlebars/Template.bal:(41:20,41:46)] incompatible types: expected '(string|hasitha/test.java.io:0.1.0:IOException)', found 'string?'
ERROR [modules/com.github.jknack.handlebars/Template.bal:(68:20,68:46)] incompatible types: expected '(string|hasitha/test.java.io:0.1.0:IOException)', found 'string?'
error: compilation contains errors

Affected Version(s)

Update9 RC1

OS, DB, other environment details and versions

No response

Related area

-> Bindgen Tool

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

keizer619 commented 3 weeks ago

This is happening in 2201.8.6 as well

NipunaRanasinghe commented 3 weeks ago

@hasithaa @keizer619 Ack. I'll look into this and, will update with the progress.