mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Added support for indexer in initializer expression, reeval Add calls
This commit is contained in:
parent
ac6f58f118
commit
596dd2401d
7 changed files with 85 additions and 66 deletions
|
@ -18,7 +18,7 @@ namespace System.Collections
|
|||
}
|
||||
}
|
||||
|
||||
extension Dictionary<K, V>
|
||||
extension Dictionary<TKey, TValue>
|
||||
{
|
||||
public static bool operator==(Self lhs, Self rhs)
|
||||
{
|
||||
|
|
|
@ -420,6 +420,10 @@ namespace Tests
|
|||
list.Sort();
|
||||
List<float> floatList = scope .() {1, 2, 3};
|
||||
|
||||
Dictionary<int, String> dict = scope .() { (1, "Foo"), [2]="Bar" };
|
||||
Test.Assert(dict[1] == "Foo");
|
||||
Test.Assert(dict[2] == "Bar");
|
||||
|
||||
ClassA ca = scope .();
|
||||
ClassB cb = scope .();
|
||||
Test.Assert(LibA.LibA0.GetVal(ca) == 123);
|
||||
|
|
|
@ -25,9 +25,9 @@ namespace Tests
|
|||
mD += (int)val2 * 10;
|
||||
}
|
||||
|
||||
public void Add(int val)
|
||||
public void Add(int val) mut
|
||||
{
|
||||
Test.FatalError("Shouldn't be called");
|
||||
mD += (int)val * 1000;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ namespace Tests
|
|||
Test.Assert(sa.mA == 123);
|
||||
Test.Assert(sa.mB == 345);
|
||||
Test.Assert(sa.mC == 456);
|
||||
Test.Assert(sa.mD == 6036);
|
||||
Test.Assert(sa.mD == 791907);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue