-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lib): Improve handling of types with generic arguments #123
- Loading branch information
1 parent
36202a1
commit 78dab2d
Showing
8 changed files
with
172 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,36 @@ | ||
namespace TypeContractor.Output; | ||
|
||
public record DestinationType(string TypeName, string? FullName, string ImportType, bool IsBuiltin, bool IsArray, bool IsReadonly, bool IsNullable, Type? InnerType) | ||
public record DestinationType( | ||
string TypeName, | ||
string? FullName, | ||
string ImportType, | ||
bool IsBuiltin, | ||
bool IsArray, | ||
bool IsReadonly, | ||
bool IsNullable, | ||
bool IsGeneric, | ||
ICollection<DestinationType> GenericTypeArguments, | ||
Type? SourceType, | ||
Type? InnerType) | ||
{ | ||
public DestinationType(string typeName, string? fullName, bool isBuiltin, bool isArray, bool isReadonly, bool isNullable, Type? innerType, string? importType = null) : this(typeName, fullName, importType ?? typeName, isBuiltin, isArray, isReadonly, isNullable, innerType) | ||
public DestinationType(string typeName, | ||
string? fullName, | ||
bool isBuiltin, | ||
bool isArray, | ||
bool isReadonly, | ||
bool isNullable, | ||
bool isGeneric, | ||
ICollection<DestinationType> genericTypeArguments, | ||
Type? innerType, | ||
Type? sourceType, | ||
string? importType = null) : this(typeName, fullName, importType ?? typeName, isBuiltin, isArray, isReadonly, isNullable, isGeneric, genericTypeArguments, sourceType, innerType) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Returns the <see cref="TypeName"/> and array brackets if the type is an array | ||
/// </summary> | ||
public string FullTypeName => $"{TypeName}{(IsArray ? "[]" : "")}"; | ||
|
||
public string DestinationTypeName => $"{TypeName}{(IsNullable ? "?" : "")}"; | ||
} |
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
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