reckfellENGINE

RF0301: Generic type argument is not Variant-compatible

Array uses an unsupported T. MustBeVariant does not make DateTime supported.

On this page

For a C# project using Reckfell.NET.Sdk 1.0.0. Fix the first build error first: later messages may be a consequence.

Cause

Array<DateTime> uses an unsupported T. MustBeVariant does not make DateTime supported.

Fix

Choose a supported representation or an ordinary .NET collection outside Variant boundaries. This example uses an integer array.

Failing example

Save the file in a test C# project and run dotnet build. This version intentionally fails to build.

Example.cs
C#
using Reckfell;

namespace DiagnosticExamples.RF0301;

public partial class Example : Entity { public Reckfell.Collections.Array<System.DateTime> Values { get; } = new(); }

Expected messages: RF0301.

Working version

Replace the failing version with these files; do not keep both declarations in the project.

Example.cs
C#
using Reckfell;

namespace DiagnosticExamples.RF0301;

public partial class Example : Entity { public Reckfell.Collections.Array<int> Values { get; } = new() { 7 }; }

Result

Values[0] equals 7 and the element type is Variant-compatible.

All C# diagnostics · C# guide

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.