Beef
Beef copied to clipboard
Compiler Error - Cannot find typealias
This block of code reproduces the issue with an extension of Dictionary:
using System.Collections;
class MyBuffer{
}
struct MyBufferState{
}
namespace System.Collections{
extension Dictionary<TKey, TValue>{
public typealias Iterator = TValue*;
}
}
typealias Hash<TKey, TValue> = Dictionary<TKey, TValue>;
class MyTest{
public typealias BufferIterator = Hash<MyBuffer, MyBufferState>.Iterator;
}
Iterator cannot be found on this line: public typealias BufferIterator = Hash<MyBuffer, MyBufferState>.Iterator;
This should have a similar issue but it works:
class MyClass<T> {
}
extension MyClass<T>{
public typealias TPointer = T*;
}
typealias MyClassAlias<T> = MyClass<T>;
static{
public typealias IntClassPointer = MyClassAlias<int>.TPointer;
public static void Test(){
MyClass<int>.TPointer x = null;
MyClassAlias<int>.TPointer y = null;
}
}