# DeferredTypeDiagnostic

Class in [Yarn.Compiler](/2.5/api/csharp/yarn.compiler.md)

Inherits from `System.Object`

## Summary

Represents a potential type error diagnostic message.

```csharp
public class DeferredTypeDiagnostic
```

## Remarks

Because a variable can be declared in a scope different from the current yarn file, or even externally, when we first hit upon any variables of which we don't know the type of we create a deferred diagnostic. The idea being that we are hoping another file or step will give the information needed to resolved the type. Later once the compiler has finished parsing every file we can see if any of these weren't resolved. If they were not they will be promoted into a full diagnostic and presented to the user.

## Methods

| Name                                                                                                                                                                                       | Description                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------- |
| [CreateDeferredTypeDiagnostic(string,Diagnostic)](/2.5/api/csharp/yarn.compiler/yarn.compiler.deferredtypediagnostic/yarn.compiler.deferredtypediagnostic.createdeferredtypediagnostic.md) | Convenience method for constructing new deferred type diagnostics |

## Properties

| Name                                                                                                                                | Description                                                                                         |
| ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [diagnostic](/2.5/api/csharp/yarn.compiler/yarn.compiler.deferredtypediagnostic/yarn.compiler.deferredtypediagnostic.diagnostic.md) | The [Diagnostic](/2.5/api/csharp/yarn.compiler/yarn.compiler.diagnostic.md) that has been deferred. |
| [Name](/2.5/api/csharp/yarn.compiler/yarn.compiler.deferredtypediagnostic/yarn.compiler.deferredtypediagnostic.name.md)             | The name of the variable who's type error is being deferred                                         |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yarnspinner.dev/2.5/api/csharp/yarn.compiler/yarn.compiler.deferredtypediagnostic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
