```cs public ref struct PtrType<T> { // inner magic to store the arbitrary pointer } public str
public ref struct PtrType<T> {
// inner magic to store the arbitrary pointer
}
public struct Ptr<T>: IPtrMarker<T> { }
public interface IPtrMarker<T> { }
public static class PtrAccessor
{
public static PtrType<T2> Inner<T2, T>(this PtrType<T> self)
where T: IPtrMarker<T2>
{
// IDK take an index and do magic with the inner of PtrType
throw null;
}
}
public class C {
public static void Main() {
PtrType<Ptr<int>> a = new();
PtrType<int> b = new();
PtrType<int> c = a.Inner<int, Ptr<int>>(); // Can I get this to infer somehow?
// Invalid: b.Inner<int, ???>();
}
}public ref struct PtrType<T> {
// inner magic to store the arbitrary pointer
}
public struct Ptr<T>: IPtrMarker<T> { }
public interface IPtrMarker<T> { }
public static class PtrAccessor
{
public static PtrType<T2> Inner<T2, T>(this PtrType<T> self)
where T: IPtrMarker<T2>
{
// IDK take an index and do magic with the inner of PtrType
throw null;
}
}
public class C {
public static void Main() {
PtrType<Ptr<int>> a = new();
PtrType<int> b = new();
PtrType<int> c = a.Inner<int, Ptr<int>>(); // Can I get this to infer somehow?
// Invalid: b.Inner<int, ???>();
}
}