-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add CreateArray and CreateMap to Helper #2145
Conversation
CODING MACHINE |
return sb.Emit(OpCode.PACK); | ||
} | ||
|
||
public static ScriptBuilder CreateMap<TKey, TValue>(this ScriptBuilder sb, IReadOnlyDictionary<TKey, TValue> map = null) |
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.
Shouldn't we keep the naming "Emit" or "Push"?
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.
Because it does not directly push the map, it actually creates a new map.
Hello @shargon and @erikzhang , if we don't add these instructions to the EmitPush method, we create a situation where you can use the EmitPush method, but it will fail with an exception. In a few words: it compiles but fails in runtime: |
@lock9 but |
Close #2143