Related smells: Ambiguous Interfaces
A well-known pattern in dependency and inclusion is then a class A inherits from class X and class B also inherits from class X, but class C inherits from both A and B and thus gets to see double of each of X's elements. The problem is solved differently in different programming and modelling languages – in grammars, it causes an ambiguity (ISO/IEC 23270:2003(E), Information technology — Programming languages — C Sharp, extracted):
reference-type ::= class-type | interface-type
| delegate-type | ... ;
class-type ::= type-name | "object" | "string";
interface-type ::= type-name ;
delegate-type ::= type-name ;
Parsing something recognisable as type-name
will cause at least a triple ambiguity since it will be an acceptable class-type
, interface-type
as well as delegate-type
[Too-Sharp2005].