mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed generic alias and generic delegate issues
This commit is contained in:
parent
639430b41c
commit
5a5287bc8b
10 changed files with 702 additions and 434 deletions
38
IDEHelper/Tests/src/Aliases.bf
Normal file
38
IDEHelper/Tests/src/Aliases.bf
Normal file
|
@ -0,0 +1,38 @@
|
|||
#pragma warning disable 168
|
||||
|
||||
using System.Collections;
|
||||
using System;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
class Aliases
|
||||
{
|
||||
class ClassA<T>
|
||||
{
|
||||
public typealias AliasA0 = int32;
|
||||
public typealias AliasA1 = List<T>;
|
||||
public typealias AliasA2<T2> = Dictionary<T, T2>;
|
||||
|
||||
public typealias AliasA3 = delegate T();
|
||||
public typealias AliasA4<T2> = delegate T(T2 val);
|
||||
|
||||
public delegate T Zag();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
ClassA<float>.AliasA0 a0 = default;
|
||||
a0 = 123;
|
||||
|
||||
ClassA<float>.AliasA1 list = scope List<float>();
|
||||
Dictionary<float, int16> dict = scope ClassA<float>.AliasA2<int16>();
|
||||
|
||||
delegate double() dlg = default;
|
||||
ClassA<double>.AliasA3 dlg2 = dlg;
|
||||
|
||||
delegate double(char8) dlg3 = default;
|
||||
ClassA<double>.AliasA4<char8> dlg4 = dlg3;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue