Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type.createInstance() throws exception for Bool constructor arguments #9025

Closed
nmamaev-tivo opened this issue Dec 12, 2019 · 1 comment
Closed
Labels

Comments

@nmamaev-tivo
Copy link

@nmamaev-tivo nmamaev-tivo commented Dec 12, 2019

Problem

The Type.createInstance() throws the following exception for Bool constructor arguments:

Exception in thread "main" Haxe Exception: Could not find any constructor that matches the provided arguments for class class <class_name>

How to reproduce

Source code (Main.hx):

class A {
	private var mB : Bool;
	public function new(b : Bool) { mB = b; }
	public function say() { trace('bool: $mB'); }
} 

class Main {
  static public function main():Void {
	var a = Type.createInstance(A, [ true ]);
	a.say();
  }
}

Build & run:

$ haxe build.java.hxml 
haxelib run hxjava hxjava_build.txt --haxe-version 4003 --feature-level 1
javac "-sourcepath" "src" "-d" "obj" "-g:none" "@cmd"
$ java -jar java/Main.jar 
Exception in thread "main" Haxe Exception: Could not find any constructor that matches the provided arguments for class class haxe.root.A
@nmamaev-tivo

This comment has been minimized.

Copy link
Author

@nmamaev-tivo nmamaev-tivo commented Dec 12, 2019

Oops, please ignore the pull request #9030 - didn't see the issue is already closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.