Something I noticed when looking at #248 was that the compiler doesn't tolerate unit names in uses clauses that are split onto multiple lines:
uses
System
.SysUtils; // E2004 Identifier redeclared: 'System'
This seems like a compiler bug (and I may raise an quality portal issue for it), because in other contexts it's perfectly valid to split the segments of the unit name on separate lines:
System
.SysUtils
.Format('', []);
While it's unusual for unit names to be long enough to wrap and be using namespaces, it's still a real issue that people could encounter because lines can be too long due to comments:
uses
System.Generics.Collections; // aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Workarounds
- disable formatting for the section (
{pasfmt off}, {pasfmt on})
- move any trailing comments to a different position
- skip the namespace for the unit and add it as a unit scope name
Something I noticed when looking at #248 was that the compiler doesn't tolerate unit names in uses clauses that are split onto multiple lines:
This seems like a compiler bug (and I may raise an quality portal issue for it), because in other contexts it's perfectly valid to split the segments of the unit name on separate lines:
System .SysUtils .Format('', []);While it's unusual for unit names to be long enough to wrap and be using namespaces, it's still a real issue that people could encounter because lines can be too long due to comments:
Workarounds
{pasfmt off},{pasfmt on})