TypeScript Version: master branch
Repro
```
(App name)
|>sources
| |>cats
| | |>elephants
| | | foo.ts
| | bar.ts
sources/cats/elephants/foo.ts
sources/cats/bar.ts
```
``` ts
// In sources/cats/elephants/foo.ts:
class Foo extends Bar {
}
// In sources/cats/bar.ts:
class Bar {
}
```
Expected behavior:
Compiler should automatically make a proper order for the classes
Actual behavior:
class Foo extends Bar {
// ~~~
// A class must be declared after its base class.
}
Workaround:
Rename "foo.ts" to "a.ts".
The compiler doesn't figure out what the "right" order of files is based on class dependencies or anything else. The usual methods are available: have a _reference.ts, use /// <reference directives, or use a module loader (if applicable)
Thanks! I would be happier if the error message told me the tip.
Most helpful comment
The compiler doesn't figure out what the "right" order of files is based on class dependencies or anything else. The usual methods are available: have a
_reference.ts, use/// <referencedirectives, or use a module loader (if applicable)