Compile::cset
Details
-
- This message is generated when an expression to be compiled involves assignments of the same variable to different types of expressions.
- The type of a variable must be the same throughout a compiled evaluation.
- Off[message] switches off the message; On[message] switches it on. For example: Off[Compile::cset].
Examples
Basic Examples (1)
Expressions of different types are assigned at different times to the same variable:
Compile[{{p, _Complex}}, Module[{x}, x = 1;x = p]]Avoid this conflict by using expressions of the same type in all assignments to the variable:
Compile[{{p, _Complex}}, Module[{x}, x = 1.0 + 0.0I;x = p]]