PR# 14942 Postcondition of BYTE_NODE.line_number is violated
Problem Report Summary
Submitter: juliant
Category: Other
Priority: Low
Date: 2008/10/31
Class: Bug
Severity: Serious
Number: 14942
Release: 6.3.7.5186
Confidential: No
Status: Open
Responsible:
Environment: Opera/9.60 (Windows NT 5.1; U; en) Presto/2.1.1
Synopsis: Postcondition of BYTE_NODE.line_number is violated
Description
The feature "line_number" of class BYTE_NODE has a strange implementation: line_number: INTEGER is -- Position where construct is located in Eiffel source. do -- Unknown by default. Result := -1 ensure Result_positive: Result > 0 end There are a lot of descendants of BYTE_NODE which don't redefine this feature, and there is no way of knowing if you can call it or not. Ballet uses it to generate back-references for the Eiffel locations in the generated BoogiePL code, but it crashes when any byte node comes which doesn't implement the feature correctly. I just removed the postcondition for me, but maybe the implementation needs to change, or a feature "is_line_info_available" needs to be added as a precondition (also for the feature "generate_line_info" which uses "line_number").
To Reproduce
Problem Report Interactions