---
layout: docs
title: codegenTypeConstant
id: interface.Facebook.HackCodegen.ICodegenFactory.codegenTypeConstant
docid: interface.Facebook.HackCodegen.ICodegenFactory.codegenTypeConstant
permalink: /docs/reference/interface.Facebook.HackCodegen.ICodegenFactory.codegenTypeConstant/
---
# Facebook\\HackCodegen\\ICodegenFactory::codegenTypeConstant()




Create a class type constant




``` Hack
public function codegenTypeConstant(
  string $name,
): Facebook\HackCodegen\CodegenTypeConstant;
```




## Parameters




- ` string $name `




## Returns




+ [` Facebook\HackCodegen\CodegenTypeConstant `](<class.Facebook.HackCodegen.CodegenTypeConstant.md>)