mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-27 03:58: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
|
@ -36,8 +36,35 @@ namespace Tests
|
|||
{
|
||||
public StructA B { get; }
|
||||
|
||||
public int C => 123;
|
||||
[SkipCall]
|
||||
public int D => 123;
|
||||
|
||||
public int E
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
get mut
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
int mZ = 9;
|
||||
|
||||
public int GetVal()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
public int GetVal() mut
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
public this()
|
||||
{
|
||||
B = .();
|
||||
|
@ -73,6 +100,15 @@ namespace Tests
|
|||
sa = sb.B;
|
||||
Test.Assert(sa.mA == 222);
|
||||
|
||||
StructC sc = default;
|
||||
Test.Assert(sc.C == 123);
|
||||
Test.Assert(sc.D == 0);
|
||||
let sc2 = sc;
|
||||
Test.Assert(sc.E == 2);
|
||||
Test.Assert(sc.GetVal() == 4);
|
||||
Test.Assert(sc2.E == 1);
|
||||
Test.Assert(sc2.GetVal() == 3);
|
||||
|
||||
ClassB cb = scope .();
|
||||
sa = cb.B;
|
||||
Test.Assert(sa.mA == 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue