diff --git a/src/CompileTimeComputation/src/CompileTimeComputationGenerator.cs b/src/CompileTimeComputation/src/CompileTimeComputationGenerator.cs index e9f707f..66de306 100644 --- a/src/CompileTimeComputation/src/CompileTimeComputationGenerator.cs +++ b/src/CompileTimeComputation/src/CompileTimeComputationGenerator.cs @@ -63,79 +63,90 @@ public static void Execute(SourceProductionContext context, (ImmutableArray ctx.AddSource("error.g.cs", $@"/* + catch (Exception ex) +{ + RegisterPostInitializationOutput(ctx => ctx.AddSource("error.g.cs", $@"/* {ex.GetType()}: {ex.Message} {ex.StackTrace} -*/")); - } - return "NO RESULT"; +*/")); +} +return "NO RESULT"; } } diff --git a/src/CompileTimeComputation/src/Constants.cs b/src/CompileTimeComputation/src/Constants.cs index 54568ec..04b6073 100644 --- a/src/CompileTimeComputation/src/Constants.cs +++ b/src/CompileTimeComputation/src/Constants.cs @@ -52,17 +52,20 @@ public static class Constants public const string CompileTimeComputationClassDeclaration = $$$""" - {{{GeneratedCodeAttributes}}} - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property)] - public sealed class {{{CompileTimeComputationOfT}}} : Attribute - { - public {{{CompileTimeComputation}}}(string name) - { - Name = name; - } - - - public string Name { get; } + {{{GeneratedCodeAttributes +} +}} + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property)] +public sealed class {{ { CompileTimeComputationOfT} }} : Attribute +{ + public +{ { { CompileTimeComputation} } } (string name) + { + Name = name; +} + + +public string Name { get; } } """; }