Beef icon indicating copy to clipboard operation
Beef copied to clipboard

[Bug] Crash when compiling non-comptime in comptime

Open m910q opened this issue 3 years ago • 0 comments

The following code crashes the IDE when compiling a Debug build. Fails correctly in Release.

Tested in latest nightly.

using System;
namespace Clean;

struct Content<TSize> where TSize : const int
{
    public this()
    {
    }
}

public struct Content
{
    [Comptime(ConstEval=true)]
    public static var Do(StringView str)
    {
        uint8[str.Length] data = ?;
        return Content<const str.Length>();
    }
}


class Program
{
    public static int Main()
    {
        const var test = Content.Do("abc");
        return 0;
    }
}

m910q avatar Sep 12 '22 21:09 m910q