p4c icon indicating copy to clipboard operation
p4c copied to clipboard

Strange `IHasSourceInfo` interface

Open asl opened this issue 1 year ago • 0 comments

The definition of IHasSourceInfo interface is quite strange:

class IHasSourceInfo {
 public:
    virtual SourceInfo getSourceInfo() const = 0;
    virtual cstring toString() const = 0;
    virtual ~IHasSourceInfo() {}
};

Essentially it demands the presence of toString method in addition to having a SourceInfo Why it is so?

asl avatar Aug 10 '24 01:08 asl