Skip to content

Std.isOfType Enum and Class #1391

Description

@ThomasDarkson

If you check whether a class or enum is a Class or Enum using Std.isOfType, both return true.

For example:

package;

class Main
{
	static function main():Void
	{
		trace(Std.isOfType(Example, Class), Std.isOfType(Example, Enum));
	}
}

class Example
{
	public var message:String;
	public function new(message:String) this.message = message;
	public function toString() return this.message;
}

Example is clearly not an enum, yet the output is true,true.

This only happens on the C++ target. I tried Eval, Neko, PHP, and JavaScript, but this doesn't happen on any of those targets.

Is there a workaround I can use?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions