HaxeFoundation / HaxeFoundation/haxe

Some issue with resolution/variance for abstracts in Map key parameter

Open
#10,221 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

Example:
```haxe
abstract Foo({ bar: Int }) {}

function main() {
final map: Map = new Map(); // error: Foo should be { bar : Int }
}
```

There is no error If underlying type for `Foo` is simply `Int`.
There is no error If `Foo` has direct `to` or `@:forward.variance`.

Looks like during selection of implementation for `Map` key type was replaced by underlying one.

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.