---
layout: docs
title: addConstant
id: class.Facebook.HackCodegen.CodegenFile.addConstant
docid: class.Facebook.HackCodegen.CodegenFile.addConstant
permalink: /docs/reference/class.Facebook.HackCodegen.CodegenFile.addConstant/
---
# Facebook\\HackCodegen\\CodegenFile::addConstant()




``` Hack
public function addConstant(
  Facebook\HackCodegen\CodegenConstant $const,
): this;
```




## Parameters




- [` Facebook\HackCodegen\CodegenConstant `](<class.Facebook.HackCodegen.CodegenConstant.md>)`` $const ``




## Returns




+ ` this `