mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-27 20:18:01 +02:00
Made method mutability part of signature and method selection
This commit is contained in:
parent
f795215b44
commit
c49d92b779
7 changed files with 129 additions and 14 deletions
|
@ -31,6 +31,24 @@ namespace Tests
|
|||
|
||||
}
|
||||
|
||||
struct StructA
|
||||
{
|
||||
int mA;
|
||||
|
||||
public int this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
get mut
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void Hey()
|
||||
{
|
||||
|
@ -43,6 +61,11 @@ namespace Tests
|
|||
Test.Assert(value == 234);
|
||||
value = ca[0];
|
||||
Test.Assert(value == 234);
|
||||
|
||||
StructA sa = default;
|
||||
let sa2 = sa;
|
||||
Test.Assert(sa[0] == 2);
|
||||
Test.Assert(sa2[0] == 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue