Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dotnet add package AlephMapper
Using `PackageReference`:

```xml
<PackageReference Include="AlephMapper" Version="0.7.1">
<PackageReference Include="AlephMapper" Version="0.7.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -82,7 +82,7 @@ With Central Package Management:

```xml
<!-- Directory.Packages.props -->
<PackageVersion Include="AlephMapper" Version="0.7.1" />
<PackageVersion Include="AlephMapper" Version="0.7.2" />

<!-- Project file -->
<PackageReference Include="AlephMapper">
Expand All @@ -103,7 +103,7 @@ When referencing the generator directly from source:

### Compiler compatibility

AlephMapper 0.7.1 requires a Roslyn compiler host compatible with `Microsoft.CodeAnalysis` 4.14 or later. This version uses Roslyn's embedded-marker support so its generated configuration attributes remain private to the consuming assembly, including when `InternalsVisibleTo` is used.
AlephMapper 0.7.2 requires a Roslyn compiler host compatible with `Microsoft.CodeAnalysis` 4.14 or later. This version uses Roslyn's embedded-marker support so its generated configuration attributes remain private to the consuming assembly, including when `InternalsVisibleTo` is used.

### Migration: `[Expressive]` to `[Projectable]`

Expand Down
11 changes: 10 additions & 1 deletion source/Adaptation/AdaptationValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ public static bool Validate(
mapping.SemanticModel,
mapping.ReturnType).ToArray();
var hasInlinedDestinationCreation = inlinedBody.GetAnnotatedNodes(SyntaxRewriters.InliningResolver.InlinedReturnCreationAnnotation).Any();
if (destinationCreations.Length == 0 && !hasInlinedDestinationCreation)
// Not every adaptation creates an object. Predicates and scalar projections can
// safely be adapted when their result type is unchanged: only the source
// parameter type needs substituting, so there is no destination construction
// to rebind.
var preservesDestinationType = SymbolEqualityComparer.Default.Equals(
adaptation.DestinationType,
mapping.ReturnType);
if (destinationCreations.Length == 0 &&
!hasInlinedDestinationCreation &&
!preservesDestinationType)
{
context.ReportDiagnostic(Diagnostic.Create(
DiagnosticDescriptors.AdaptUnsupportedSyntax,
Expand Down
2 changes: 1 addition & 1 deletion source/AlephMapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Raffinert/AlephMapper</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageVersion>0.7.1</PackageVersion>
<PackageVersion>0.7.2</PackageVersion>
<BuildNumber Condition="'$(BuildNumber)' == ''">0</BuildNumber>
<Version>$(PackageVersion)</Version>
<AssemblyVersion>$(PackageVersion).$(BuildNumber)</AssemblyVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class PersonMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class PersonMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class AdaptUpdateMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class CircularMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class CircularPropertyMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class CollectionMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class ConditionalPatternMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class EfCoreIgnoreMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class EfCoreMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class SampleMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class ConditionalExtensionTestPersonMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class ExtensionTestAddressMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class ExtensionTestPersonMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class Mapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class SimpleObjectMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace AlephMapper.Tests.MethodGroupToEntityList;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class PersonMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests.MultiParamExtensionInlining;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class PersonProductMapperIgnore
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests.MultiParamExtensionInlining;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class PersonProductMapperRewrite
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests.MultiParamExtensionInlining;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class ProductMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests.MultiParameterInlining;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class MultiParamProjectableMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests.MultiParameterInlining;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class NamedArgMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests.MultiParameterInlining;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class NestedMultiParamMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests.MultiParameterInlining;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class PersonMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests.MultiParameterInlining;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class UpdatableMultiParamMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class NestedExt_AddressMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class NestedExt_PersonMapper_Ignore
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class NestedExt_PersonMapper_Rewrite
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class NullCoalesceValueAssignmentMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class IgnoreMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class NoneMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class RewriteMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class NullableDisabledMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class NullableEnabledMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class TechDebtAddressMapper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class TechDebtPersonMapperIgnore
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class TechDebtPersonMapperNone
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class TechDebtPersonMapperRewrite
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace AlephMapper.Tests;

[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.1.0")]
[global::System.CodeDom.Compiler.GeneratedCode("AlephMapper", "0.7.2.0")]
partial class Address1Mapper
{
/// <summary>
Expand Down
Loading
Loading