Skip to content

abstract @:to casts are not considered for operators #8427

Description

@nadako
abstract A(Int) from Int {
	@:to function toInt():Int return this;
}

class Main {
	static function main() {
		10 + (10 : A);
	}
}

This gives A should be Int, however I would expect it to call toInt(), especially considering that adding direct to Int works.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions