-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Not again: A class must be declared after its base class. #14806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you share an isolated snippet of code that causes this issue and broke between 2.1.5 and 2.2.2? |
Hello, It will be hard as solution has over 300 files. I think this functionality had some issues from the very beginning. I was never able to figure it out. With different releases of TS I could remove some references or had to add some - meaning this was not stable. I observed 2 additional strange things with
In I don't know if many people uses Let me know how I can help ... |
@pankleks can you share a repro, we would love to investigate more and fix the underlying issue. |
@mhegazy it's not code I can share publicly - only on priv. |
can you reproduce the issue on a sample project, if you distill it down to two/three files that are showing the symptoms, we would only be interested in class heritage clauses, and triple-slash references not the rest of the file. |
Hello, Please find solution strip from most of the code. Compiles OK with 2.1.5, fails with 2.2.2 |
I can't repro this with 2.2.2 |
What file ordering mechanism does this project use? I don't see any reference directives or explicit file list - it's likely TS is just picking up these files in the order they appear on disk, which isn't even stable machine-to-machine |
@RyanCavanaugh just use: "incluide": [
"Planck.Core/*.ts",
"Planck.UI/*.ts"
] |
What's the output of |
@RyanCavanaugh If I put all classes in single TS file it's compiling fine. And at last, why it's working in 2.1.5 and not in 2.2.2? |
Looking at the output - it's not honoring order of include in |
It's always been the case that tsc does not figure out an ordering of your input files (see #1359 and similar threads). I can't figure out how this code ever ran without error -- certainly any class defined in a file alphabetically before Can you confirm that |
Looks like 2.1.5 order is following one specified in include. |
so here are my thoughts:
Using Today, I really don't know when to reference or not - as it's not stable. Thanks for help! |
Hello, any update on this? I really think solution 2 is the way to go here, and it should be easy to implement. Thanks! |
Bug. While the order from any given |
Awesome - thank you so much! |
Hello, any update when this might be implemented? If you point me to code maybe I can try to help. |
! |
Guys, I used "include" and have same result. |
It's working for me on the |
Hello,
I just upgraded 2.1.5 to 2.2.2 and get lots of this errors (was all fine on 2.1.5).
For your information I'm not using modules - generating all into single JS file.
The text was updated successfully, but these errors were encountered: