# dmd.aliasthis

Implements the `alias this` symbol.

Specification: Alias This

#### Authors

Walter Bright

#### License

Boost License 1.0

Source: aliasthis.d

Documentation: https://dlang.org/phobos/dmd_aliasthis.html

Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/aliasthis.d

- `AliasThis`

  #### Declaration

  `class `AliasThis`: dmd.dsymbol.Dsymbol;`

  alias ident this;

  - `sym`

    #### Declaration

    `Dsymbol `sym`;`

    The symbol this `alias this` resolves to

  - `isDeprecated_`

    #### Declaration

    `bool `isDeprecated_`;`

    Whether this `alias this` is deprecated or not

- `checkDeprecatedAliasThis`

  #### Declaration

  `bool `checkDeprecatedAliasThis`(AliasThis `at`, ref const Loc `loc`, Scope* `sc`);`

  Check if an `alias this` is deprecated

  #### Discussion

  Usually one would use `expression.checkDeprecated(scope, aliasthis)` to check if `expression` uses a deprecated `aliasthis`, but this calls `toPrettyChars` which lead to the following message: "Deprecation: alias this `fullyqualified.aggregate.__anonymous` is deprecated"

  #### Parameters

  `AliasThis `at`` | The `AliasThis` object to check
  `Loc `loc`` | `Loc` of the expression triggering the access to ``at``
  `Scope* `sc`` | `Scope` of the expression (deprecations do not trigger in deprecated scopes)

  #### Return Value

  Whether the alias this was reported as deprecated.