-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turn implicit conversion into compiled templates
- Loading branch information
Showing
6 changed files
with
20 additions
and
20 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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,10 @@ | ||
// <auto-generated /> | ||
|
||
using StructId; | ||
|
||
[TStructId] | ||
file partial record struct TSelf(string Value) | ||
{ | ||
public static implicit operator string(TSelf id) => id.Value; | ||
public static explicit operator TSelf(string value) => new(value); | ||
} |
9 changes: 7 additions & 2 deletions
9
...StructId/ResourceTemplates/ConversionT.cs → src/StructId/Templates/ConversionT.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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
// <auto-generated /> | ||
|
||
readonly partial record struct TSelf | ||
using StructId; | ||
|
||
[TStructId] | ||
file partial record struct TSelf(TId Value) | ||
{ | ||
public static implicit operator TId(TSelf id) => id.Value; | ||
public static explicit operator TSelf(TId value) => new(value); | ||
} | ||
} | ||
|
||
file record struct TId; |