Skip to content

Commit

Permalink
Perform injections after wraps (safety issue), add more APIs to Lilik…
Browse files Browse the repository at this point in the history
…oiMutator.cs

Adds type and entry point data to the mutator.
  • Loading branch information
Mooshua committed Aug 16, 2023
1 parent 627a808 commit 72377c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lilikoi/Compiler/Public/LilikoiCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ public LilikoiContainer Finish()
Internal.HostFor();
Internal.ParameterSafety();

Internal.InjectionsFor(Internal.Method.Host);

foreach (var implicitWrap in ImplicitWraps)
Internal.ImplicitWrap(implicitWrap);
Internal.WrapsFor();

Internal.InjectionsFor(Internal.Method.Host);

foreach (var (implicitWildcard, type) in ImplicitWildcards)
Internal.ImplicitWildcard(implicitWildcard, type);

Expand Down
13 changes: 13 additions & 0 deletions Lilikoi/Compiler/Public/LilikoiMutator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// ========================
#region

using System.Reflection;

using Lilikoi.Attributes.Builders;
using Lilikoi.Context;

Expand Down Expand Up @@ -132,4 +134,15 @@ public LilikoiMutator Wildcard<TParameter>(Type type, TParameter value = null)
/// The return type of the underlying function
/// </summary>
public Type Result => Compiler.Internal.Method.Return;

/// <summary>
/// The entry point that the mutator is applying to
/// </summary>
public MethodInfo Method => Compiler.Internal.Method.Entry;

/// <summary>
/// The host that the entry point belongs to.
/// Note that this is the same as Method.DeclaringType
/// </summary>
public Type Host => Compiler.Internal.Method.Host;
}

0 comments on commit 72377c5

Please sign in to comment.