To reproduce:
var code =
"""
using Rocks;
using System.Threading.Tasks;
public class EntityEntry<TEntity>
where TEntity : class { }
public class DbSet<TEntity>
where TEntity : class
{
public virtual ValueTask<EntityEntry<TEntity>> AddAsync() =>
new();
}
public static class Test
{
public static void Go()
{
var expectations = Rock.Make<DbSet<object>>();
}
}
""";
This leads to the following error:
error CS0246: The type or namespace name 'EntityEntry<>' could not be found (are you missing a using directive or an assembly reference?)
It's because of this gen-d code:
public override global::System.Threading.Tasks.ValueTask<global::EntityEntry<object>> AddAsync()
{
return new global::System.Threading.Tasks.ValueTask<global::EntityEntry<object>>(default(EntityEntry<object>)!);
}
The type in default isn't fully-qualified.
This was found in Microsoft.EntityFrameworkCore.DbSet<object> (among a couple of other types).
To reproduce:
This leads to the following error:
It's because of this gen-d code:
The type in
defaultisn't fully-qualified.This was found in
Microsoft.EntityFrameworkCore.DbSet<object>(among a couple of other types).