Skip to content

The Great QuantHash refactor broke testing #13

Description

@lizmat

As far as I can see, the behaviour of:

MultiVector (+) MultiVector.new

has changed with this refactor. Before, this would return:

().MultiVector

but now it returns:

mix()

which then causes a typecheck error on the return value.

Now, I think the value mix() is wrong.

Standard QuantHash semantics should have yielded:

(MultiVector=>1).MultiVector

As can be observed with:

% raku -e 'class A is Mix does Callable { }; dd A (+) A.new'
Real  = (A=>1).Mix

Now, I've been able to trace this to the existence of the list method in the MultiVector class. Remove that, and the MultiVector (+) ().MultiVector expression yields the expected result (MultiVector=>1).Mix. However, that is still not the result the tests want, they want 0 returned.

As far as I can tell, this is the only module that is affected by the GQR. And since there are comments in the code such as "the use of C is suspicious here, but it seems to work, so..." it feels like you're doing something that should probably be considered illegal before (but has become illegal now).

I've not been able to pinpoint exactly what is happening there that would cause this regression. Would appreciate another set of eyes on this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions