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




``` Hack
public function setType(
  string $type,
): this;
```




## Parameters




* ` string $type `




## Returns




- ` this `