Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out if an interface is implemented?

Tags:

haxe

How can I find out if an object implements an interface? In other words I need a possibility to check if an object can be cast to a specific type (e.g. a specific interface).

like image 320
nepa Avatar asked Feb 20 '23 09:02

nepa


1 Answers

Std.is(). Or use a safe cast and it will throw an error if it fails.

like image 95
Andy Li Avatar answered Mar 08 '23 08:03

Andy Li