Skip to content

Conversation

@AlexHaxe
Copy link
Contributor

No description provided.

var self = this;
var runThread:Thread = Thread.create(function()
var createThread = Thread.create;
#if (haxe4 && (haxe >= version("4.2.0-rc.1")))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not #if (haxe >= version("4.2.0-rc.1"))?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mb?

var createThread = #if (haxe >= version("4.2.0-rc.1")) Thread.createWithEventLoop #else Thread.create #end;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to break compatibility with Haxe 3, version("x.x.x") is a Haxe 4 feature

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that being said... I should have tested with Haxe 3, which makes a bit more ugly. I had to split the conditionals to make it work.

var runThread:Thread = Thread.create(function()
var createThread = Thread.create;
#if haxe4
#if (haxe >= version("4.2.0-rc.1"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#if (haxe> = version (" 4.2.0-rc.1 ")) doesn't work without #if haxe4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it works fine on Haxe 4, but not on Haxe 3

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think it wouldn't compile, but I would still do one assignment instead of two))

@SlavaRa
Copy link
Contributor

SlavaRa commented Dec 19, 2020

looks good

package massive.munit;

#if haxe4
#if (haxe >= version("4.1.0"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add tab?

#if haxe4
    #if (...
    #else
        ...
    #end
#else
    ...
#end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and

import Std.isOfType as isOfType;

;)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants