Closed Neverbirth closed 6 years ago
This one will be tricky to cover.
I'm even unable to catch the error:
try var expr = macro new $typePath( $a { args } ) catch(e:Dynamic) trace('Catch it please!');
The only way I found is to handle it manually for now.
var t = Context.getType( typePath.pack.join('.') + '.' + typePath.name );
switch( t )
{
case TInst( t, params ): if ( !t.get().constructor.get().isPublic )
Context.error( 'WTF, you try to instantiate a class with a private constructor!', t.get().constructor.get().pos );
case _:
}
Try to instantiate some class with private constructor in Flow, the output is just:
No real indication of the Flow file and line.