Skip to content

Conditional operator exception #1840

Closed
Closed
@igor-tkachev

Description

Conditional operator generates an exception.

Steps to reproduce

Breaking commit - e41d05e

[Test]
public void Test([IncludeDataSources(
	ProviderName.SqlCe, ProviderName.SqlServer2012, ProviderName.SqlServer2014)] string context)
{
	using (var db = GetDataContext(context))
	{
		var query =
			from p in db.Parent
			from c in db.Child.Take(1).DefaultIfEmpty()
			select new
			{
				a = p.ParentID == 1 ? c != null ? "1" : "2" : "3"
			};

		_ = query.ToList();
	}
}

Environment details

linq2db version: 2.7.1

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions