E2: Remove duplicate directive error for includes? #2839
Replies: 8 comments
-
The checks exist for |
Beta Was this translation helpful? Give feedback.
-
Just to be consistent I would say yes, I can't think of any reasons not to. From what I could tell and what I was told in the discord, these checks don't actually do anything other than force formatting rules on your code. |
Beta Was this translation helpful? Give feedback.
-
Has any further consideration been put into this? Dirty workarounds just bloat code into unreadable territory. |
Beta Was this translation helpful? Give feedback.
-
I'm happy for the checks to be removed. Part of me thinks that duplicate |
Beta Was this translation helpful? Give feedback.
-
Pretty sure it's to avoid bugs that would pop up with scripts using same var names. |
Beta Was this translation helpful? Give feedback.
-
Can this error use the new warning system instead? |
Beta Was this translation helpful? Give feedback.
-
Implemented in #2869 |
Beta Was this translation helpful? Give feedback.
-
Talking about these errors here:
Directive (@persist) contains multiple definitions of the same variable
It would be great if the limitation could be removed when including a file, barring any technical reasons for having it there. As it is now, cross-including and libraries that need to span multiple files (that have to use the same variables) are not easy to write or convenient to use.
Edit:
I'm not always the best with words, so I'm going to post an example from the discord by Divran as to why I think this should be considered:
and also
Currently there are ways around this limitation (such as defining the variables ahead of the main code in each file) but they are not very pretty.
Beta Was this translation helpful? Give feedback.
All reactions