HaxeFoundation / HaxeFoundation/haxe

`Dynamic` type parameter casting issue

Open
#7,246 0 comments 0 reactions 0 assignees View on GitHub
feature-dynamic
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

The issue is illustrated by this example:
https://try.haxe.org/#279ae
Note: `Future.NEVER` has type of `Future`
The example uses tink_core's Futures but it doesn't have to...

A `Future` can't be cast to `Future` when assigning to a variable, but it works using a trick with a type parameter function.

I think if the "trick" works, then a simple assignment should also work.
In other words, if it's ok to assign `Dynamic` to `Int`, why not `Future` to `Future`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.