Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Inlining/Extension/Inheritance issue #71

@pbroadbery

Description

@pbroadbery

.. this comes from investingating issues with Complex Integer.

Start with a domain like:

    Complex(T: ..): with {
      *: (T, %) -> %
      *: (I, %) -> % 
    }

Now inherit these definitions...

    extend Complex(T: ...) with {
       f: (T, %) -> %
    } == add {
      f(t: T, x: %): % == t * x;
    }

All good so far.

   f$Complex I

Now call f. If the compiler has chosen to inline "_" in the definition of f, it hopes to get the first definition of _. Unfortunately, both definitions of "*" have the same hash code in the case of Complex I, and if we get the second, mayhem will result.

For a real example, see the initial version of reciprocal in sal_complex.as.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions