def _create_struct_field(self, env, stone_field):
if isinstance(stone_field, AstVoidField):<EOL><INDENT>raise InvalidSpec(<EOL>'<STR_LIT>' %<EOL>quote(stone_field.name),<EOL>stone_field.lineno, stone_field.path)<EOL><DEDENT>data_type = self._resolve_type(env, stone_field.type_ref)<EOL>annotations = [self._resolve_annotation_type(env, annotation)<EOL>for annotation in stone_field.annotations]<EOL>if isinstance(data_type, Void):<EOL><INDENT>raise InvalidSpec(<EOL>'<STR_LIT>' %<EOL>quote(stone_field.name),<EOL>stone_field.lineno, stone_field.path)<EOL><DEDENT>elif isinstance(data_type, Nullable) and stone_field.has_default:<EOL><INDENT>raise InvalidSpec('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>quote(stone_field.name),<EOL>stone_field.lineno, stone_field.path)<EOL><DEDENT>api_type_field = StructField(<EOL>name=stone_field.name,<EOL>data_type=data_type,<EOL>doc=stone_field.doc,<EOL>ast_node=stone_field,<EOL>)<EOL>api_type_field.set_annotations(annotations)<EOL>return api_type_field<EOL>
This function resolves symbols to objects that we've instantiated in
the current environment. For example, a field with data type named
"String" is pointed to a String() object.

The caller needs to ensure that this stone_field is for a Struct and not
for a Union.

Returns:
    stone.data_type.StructField: A field of a struct.