Beef
Beef copied to clipboard
[Bug] Type resolution error occurs when using a getter through a derived class pointer array element.
Summary
A compilation error occurs when the following criteria is satisfied:
- A pointer to a derived class instance is access through the array indexing operator.
- That pointer is used to access a getter in the base class.
In this case, the return type of the getter is determined to be void.
Minimal repro case:
using System;
namespace HelloWorld
{
struct Foo
{
public int bar;
}
struct Base
{
private Foo _foo;
public Foo foo => _foo;
}
struct Derived : Base
{
}
class Program
{
static void Main()
{
Derived*[1] derived = ?;
Console.WriteLine("bar: {}", derived[0].foo.bar);
}
}
}
Compilation error:
ERROR: Unable to find member 'bar' in 'void' at line 25:57 in /Project/src/Program.bf
Console.WriteLine("bar: {}", derived[0].foo.bar);
Code
https://trybeef.netlify.app/#/JGCWIR