This repository has been archived by the owner on Jan 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#133: Handle type nullability in custom conversions
- Loading branch information
1 parent
76445d1
commit 92c142c
Showing
7 changed files
with
131 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
MappingGenerator/MappingGenerator/MappingGenerator/Mappings/AnnotatedType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using MappingGenerator.Mappings.SourceFinders; | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace MappingGenerator.Mappings | ||
{ | ||
public class AnnotatedType | ||
{ | ||
public ITypeSymbol Type { get; } | ||
public bool CanBeNull { get; } | ||
|
||
public AnnotatedType(ITypeSymbol type) | ||
{ | ||
Type = type; | ||
CanBeNull = type.CanBeNull(); | ||
} | ||
|
||
public AnnotatedType(ITypeSymbol type, bool canBeNull) | ||
{ | ||
Type = type; | ||
CanBeNull = canBeNull; | ||
} | ||
|
||
public AnnotatedType AsNotNull() | ||
{ | ||
return new AnnotatedType(Type, false); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters