Skip to content

Script using enum array fails to compile after upgrading to 2.39 WIP #84

Description

@HenryAWE

Found by a test case of asbind20.
Script segment:

my_enum[] arr(n: 2);
assert(arr.size == 2);
assert(arr[0] == my_enum::zero);
assert(arr[1] == my_enum::zero);

The message callback says:

ERROR (factory_size_enum:3:15): No conversion from 'my_enum' to 'int64' available.
ERROR (factory_size_enum:4:15): No conversion from 'my_enum' to 'int64' available.

The test suites of asbind20 are using its own array implementation, here are the declarations of related interfaces:

array<T> //array type registered to the script engine

// opIndex declarations
T& opIndex(int)
const T& opIndex(int) const

// enum in C++
// registered by RegisterEnumValue
enum my_enum
{
    neg_one = -1,
    zero = 0,
    one = 1
}

The above example is using code from the newest commit of AngelScript.
This script compiles & runs as expected using AS 2.38 & 2.37.

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions