Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CS1503 cannot convert from 'object' to #73098

Closed
martore opened this issue Apr 19, 2024 · 1 comment
Closed

CS1503 cannot convert from 'object' to #73098

martore opened this issue Apr 19, 2024 · 1 comment

Comments

@martore
Copy link

martore commented Apr 19, 2024

Version Used: Visual Studio 17.10.0 Preview 4.0, Visual Studio 17.10.0 Preview 3.0, .NET 8

Steps to Reproduce:

using AutoMapper;

var autoMapperCfg = new MapperConfiguration(cfg =>
{
    cfg.CreateMap<Car, Vehicle>().ReverseMap();
});

var autoMapper = autoMapperCfg.CreateMapper();

dynamic myCar = new Car();
Vehicle myVehicle = new();

var map =  autoMapper.Map<Vehicle, Car>(Activator.CreateInstance(myCar.GetType(), myVehicle)); // <-- CS1503

public class Vehicle { }
public class Car : Vehicle { }

Diagnostic Id: CS1503 cannot convert from 'object' to 'Vehicle'

Expected Behavior: Worked fine until Visual Studio 17.10.0 Preview 3.0.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 19, 2024
@RikkiGibson RikkiGibson added Bug Area-Compilers and removed untriaged Issues and PRs which have not yet been triaged by a lead Area-IDE labels Apr 29, 2024
@RikkiGibson
Copy link
Contributor

This looks like a duplicate of #72750. Please let us know if it continues to repro in the latest 17.10 preview.

@RikkiGibson RikkiGibson closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants