-
Notifications
You must be signed in to change notification settings - Fork 423
Open
Description
Upcasting an interface-typed (existential) value from a derived interface to a base interface causes an internal compiler error (ICE 99999) with the message "Unexpected context type for parameter info retrieval".
This affects both generic and non-generic interface hierarchies.
Reproduction (non-generic):
interface IBase
{
float getValue();
}
interface IDerived : IBase
{
float transform(float input);
}
struct Impl : IDerived
{
float v;
float getValue() { return v; }
float transform(float input) { return input + v; }
}
void test()
{
IDerived derived;
derived = Impl(10.0);
// This upcast triggers ICE 99999
IBase base = derived;
float x = base.getValue();
}Reproduction (generic):
interface IBase<T : IArithmetic>
{
T getValue();
}
interface IDerived<T : IArithmetic> : IBase<T>
{
T transform(T input);
}
struct Impl : IDerived<float>
{
float v;
float getValue() { return v; }
float transform(float input) { return input + v; }
}
void test()
{
IDerived<float> derived;
derived = Impl(10.0);
// This upcast also triggers ICE 99999
IBase<float> base = derived;
float x = base.getValue();
}Note: Using IDerived directly (without upcasting to IBase) works correctly with dynamic dispatch. The ICE occurs specifically when assigning the existential to the base interface type.
Reactions are currently unavailable