gives information about the enclosing compiled function.
CurrentCompiledFunctionData[prop]
gives the value of the property prop for the enclosing compiled function.


CurrentCompiledFunctionData
gives information about the enclosing compiled function.
CurrentCompiledFunctionData[prop]
gives the value of the property prop for the enclosing compiled function.
Details

- CurrentCompiledFunctionData is only available in compiled code.
- The name returned from a call to CurrentCompiledFunctionData will be that set by FunctionDeclaration.
- CurrentCompiledFunctionData["ReturnType"] is a useful way to access the return type of a function.
- A call to CurrentCompiledFunctionData returns a result of type "CompiledFunctionData".
- The result of a call to CurrentCompiledFunctionData contains the type of the enclosing function, and therefore it cannot be returned from a function.
- The following properties are supported:
-
"Type" the type of the enclosing function "ReturnType" the return type of the enclosing function
Examples
open all close allBasic Examples (2)
Compile and evaluate a function that prints out information about the current function:
Print out the type of the function:
Print out the return type of the function:
If CurrentCompiledFunctionData appears in a function with a name, this is included:
Scope (3)
CurrentCompiledFunctionData can only be used in compiled code:

A function declaration that returns a zero of the return type:
The result of CurrentCompiledFunctionData can be passed into a function that can extract information such as the name:
This prints the name of the function in which CurrentCompiledFunctionData appears:
Possible Issues (1)
The result of a call to CurrentCompiledFunctionData cannot be returned from a function:

If CurrentCompiledFunctionData[] is cast to an "InertExpression", then compilation can succeed:
When it is called, the resulting CompiledFunctionData object shows that the return type is an "InertExpression":
Tech Notes
Related Guides
History
Text
Wolfram Research (2025), CurrentCompiledFunctionData, Wolfram Language function, https://reference.wolfram.com/language/ref/CurrentCompiledFunctionData.html.
CMS
Wolfram Language. 2025. "CurrentCompiledFunctionData." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CurrentCompiledFunctionData.html.
APA
Wolfram Language. (2025). CurrentCompiledFunctionData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CurrentCompiledFunctionData.html
BibTeX
@misc{reference.wolfram_2025_currentcompiledfunctiondata, author="Wolfram Research", title="{CurrentCompiledFunctionData}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/CurrentCompiledFunctionData.html}", note=[Accessed: 04-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_currentcompiledfunctiondata, organization={Wolfram Research}, title={CurrentCompiledFunctionData}, year={2025}, url={https://reference.wolfram.com/language/ref/CurrentCompiledFunctionData.html}, note=[Accessed: 04-August-2025]}