Algebraic changing type when in associative array

rous email at example.com
Tue Feb 4 11:45:50 UTC 2020


I'm defining an Algebraic type like this:
alias Expr = Algebraic!(This[char], string, int);
However, when I create an Expr from an associative array of chars 
and Exprs, the Exprs seem to change from Algebraic to 
VariantN!32LU types. This is illustrated in the following error 
message:
cannot pass argument ex.opIndex(' ') of type VariantN!32LU to 
parameter VariantN!(16LU, This[char], string, int) ex
when I try to call a function that takes an Expr with ex[' '].
If there is no way to ensure that it does not change type, is 
there a way to cast it back?


More information about the Digitalmars-d-learn mailing list