-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace T4 with raw string literale #29
Changes from all commits
79da641
2a6142d
0635db9
7aca1e1
a5b7427
e342608
ddcaf9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,10 @@ | |
// </auto-generated> | ||
#pragma warning disable CS8669 | ||
using System; | ||
|
||
namespace FileGenerate | ||
{ | ||
[System.ComponentModel.TypeConverter(typeof(ATypeConverter))] | ||
public readonly partial struct A : IEquatable<A> | ||
readonly partial struct A : IEquatable<A> | ||
{ | ||
readonly int value; | ||
|
||
|
@@ -17,8 +16,7 @@ public A(int value) | |
{ | ||
this.value = value; | ||
} | ||
|
||
|
||
|
||
public static explicit operator int(A value) | ||
{ | ||
return value.value; | ||
|
@@ -47,7 +45,7 @@ public override bool Equals(object obj) | |
return value.Equals((int)obj); | ||
} | ||
|
||
return value.Equals(obj); | ||
return value.Equals(obj); | ||
} | ||
|
||
public override int GetHashCode() | ||
|
@@ -57,7 +55,7 @@ public override int GetHashCode() | |
|
||
public override string ToString() | ||
{ | ||
return "A(" + value + ")"; | ||
return value.ToString(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. different ToString result?(I don't know which is better) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I generate again with It looks like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I recall changing it to a straightforward ToString because having type information made it harder to read, and it also reduced the convenience of ToString. So, this implementation is OK! |
||
} | ||
|
||
public static bool operator ==(in A x, in A y) | ||
|
@@ -70,15 +68,6 @@ public override string ToString() | |
return !x.value.Equals(y.value); | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
// Default | ||
private class ATypeConverter : System.ComponentModel.TypeConverter | ||
{ | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The master branch seems to omit
public
modifier as well.https://github.com/Cysharp/UnitGenerator/blob/master/src/UnitGenerator/CodeTemplate.tt#L34
Probably, since it is partial, the handwritten code will be followed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, omit modifier is ok.