| | | 1 | | namespace NexusLabs.Needlr.Generators.Models; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Records that a discovered type argument cannot legally close a composition type because it violates |
| | | 5 | | /// the composition's generic constraints. Surfaced as the <c>NDLRGEN038</c> build diagnostic, and the |
| | | 6 | | /// corresponding registration is skipped rather than emitting code that fails to compile. |
| | | 7 | | /// </summary> |
| | | 8 | | internal readonly struct ComposedConstraintViolation |
| | | 9 | | { |
| | | 10 | | public ComposedConstraintViolation( |
| | | 11 | | string compositionTypeName, |
| | | 12 | | string typeArgumentName, |
| | | 13 | | string sourceInterfaceName, |
| | | 14 | | string? sourceFilePath) |
| | | 15 | | { |
| | 34 | 16 | | CompositionTypeName = compositionTypeName; |
| | 34 | 17 | | TypeArgumentName = typeArgumentName; |
| | 34 | 18 | | SourceInterfaceName = sourceInterfaceName; |
| | 34 | 19 | | SourceFilePath = sourceFilePath; |
| | 34 | 20 | | } |
| | | 21 | | |
| | | 22 | | /// <summary>The composition type that could not be closed (e.g., FooCore<TData>).</summary> |
| | 34 | 23 | | public string CompositionTypeName { get; } |
| | | 24 | | |
| | | 25 | | /// <summary>The offending type argument(s), comma-separated (e.g., StructData).</summary> |
| | 34 | 26 | | public string TypeArgumentName { get; } |
| | | 27 | | |
| | | 28 | | /// <summary>The source open generic interface whose implementation produced the type argument.</summary> |
| | 34 | 29 | | public string SourceInterfaceName { get; } |
| | | 30 | | |
| | | 31 | | /// <summary>The source file path of the composition type, if available.</summary> |
| | 0 | 32 | | public string? SourceFilePath { get; } |
| | | 33 | | } |