Skip to content

Bug: Records and Schemas #388

Answered by MikeStall
mdocter asked this question in Q&A
May 11, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Here's the pointer to the code that determines the type of an If() ...

public override bool CheckInvocation(TexlBinding binding, TexlNode[] args, DType[] argTypes, IErrorContainer errors, out DType returnType, out Dictionary<TexlNode, DType> nodeToCoercedTypeMap)

Along with some unit tests:
https://github.com/microsoft/Power-Fx/blob/main/src/tests/Microsoft.PowerFx.Core.Tests/ExpressionTestCases/If.txt

If()'s resulting type is basically an intersection of the true and false branches - It doesn't know until runtime which branch will actually be, so the intersection is a safe set that will…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@mdocter
Comment options

@mdocter
Comment options

Answer selected by mdocter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #387 on May 11, 2022 15:54.