The redundant-object rule reports an attribute as redundant whenever the only
references to it are written in absolute form. In objectionary/eo, the file
eo-runtime/src/main/eo/os.eo declares is-linux at line 14 and reads it three
times, at lines 36, 41 and 42, always as os.is-linux. The lint still says:
os:14 The object "is-linux" is redundant and may be inlined (redundant-object/S)
The referenced-by-name key in
src/main/resources/org/eolang/lints/misc/redundant-object.xsl:11 indexes only
those o[@base] whose @base matches ^ξ(?:\.ρ)*\., so the three references
above, which the parser writes as Φ.os.is-linux and Φ.os.is-linux.and, are
counted as zero. The same blindness hits every public attribute of a library
object, since callers in other files can only reach it through Φ: on
eo-runtime the rule reports 166 defects and 74 of them are API attributes such
as win32.rdonly, tuple.empty, posix.stdout and number.as-i16, none of
which can be inlined.
Extend the key to index Φ-rooted references too: when @base matches
^Φ\., use the token that follows the name of the top object in
/object/o/@name, instead of mapping the whole reference to the empty string.
The
redundant-objectrule reports an attribute as redundant whenever the onlyreferences to it are written in absolute form. In
objectionary/eo, the fileeo-runtime/src/main/eo/os.eodeclaresis-linuxat line 14 and reads it threetimes, at lines 36, 41 and 42, always as
os.is-linux. The lint still says:The
referenced-by-namekey insrc/main/resources/org/eolang/lints/misc/redundant-object.xsl:11indexes onlythose
o[@base]whose@basematches^ξ(?:\.ρ)*\., so the three referencesabove, which the parser writes as
Φ.os.is-linuxandΦ.os.is-linux.and, arecounted as zero. The same blindness hits every public attribute of a library
object, since callers in other files can only reach it through
Φ: oneo-runtimethe rule reports 166 defects and 74 of them are API attributes suchas
win32.rdonly,tuple.empty,posix.stdoutandnumber.as-i16, none ofwhich can be inlined.
Extend the key to index
Φ-rooted references too: when@basematches^Φ\., use the token that follows the name of the top object in/object/o/@name, instead of mapping the whole reference to the empty string.