Conversation
29e1cb3 to
79da641
Compare
7bd6526 to
2a6142d
Compare
| } | ||
|
|
||
| public static explicit operator A(int value) | ||
| public static implicit operator A(int value) |
There was a problem hiding this comment.
what the reason of different result, implicit and explicit?
There was a problem hiding this comment.
Oh.. simply my mistake... fixed. 0635db9
| using System; | ||
|
|
||
| namespace FileGenerate | ||
| #pragma warning disable CS8669 |
|
|
||
| namespace FileGenerate | ||
| #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> |
There was a problem hiding this comment.
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 ?
| public override string ToString() | ||
| { | ||
| return "A(" + value + ")"; | ||
| return value.ToString(); |
There was a problem hiding this comment.
different ToString result?(I don't know which is better)
There was a problem hiding this comment.
If I generate again with master branch, I seem to get a diff of this file.
It looks like value.ToString() is probably the implementation currently in use. Is this correct?
https://github.com/Cysharp/UnitGenerator/blob/master/src/UnitGenerator/CodeTemplate.tt#L88
There was a problem hiding this comment.
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!
Currently, T4 is used to implement code generation, but it will be replaced with a rustic template.
motivation: