Skip to content

Missing FQNs in Makes #248

@JasonBock

Description

@JasonBock

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).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions