cadl/docs/language-basics
Abiria 7517c9175e
docs: fix incorrect example code in namespaces.md (#3195)
## Backgrounds

I first reported this on discussion: #3194

## Issue description

There is a code sample
[here](https://typespec.io/docs/language-basics/namespaces#using-namespaces)
describing the scope of an item introduced by `using`.

```ts
namespace One {
  model A {}
}

namespace Two {
  using One;
  alias B = A; // This is valid
}

alias C = One.A; // This is not valid
alias C = Two.B; // This is valid
```

## Expected result

The code should failed to compile because of `One.A`.

## Actual result

It compiles without any warning.

## How to fix

It appears that the original intent was to show that accessing an item
introduced with `using` outside the scope of `using` is not possible. In
this code, the 'invalid accessing' is `Two.A`.

## Changes

- change `One.A` to `Two.A`
2024-04-23 02:21:09 +00:00
..
alias.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
built-in-types.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
decorators.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
documentation.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
enums.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
imports.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
interfaces.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
intersections.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
models.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
namespaces.md docs: fix incorrect example code in namespaces.md (#3195) 2024-04-23 02:21:09 +00:00
operations.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
overview.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
scalars.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
templates.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
type-literals.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
type-relations.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00
unions.md Website & Docs Cleanup (#3002) 2024-03-11 18:56:35 -07:00