specialize does not work properly if the return type is sharpened
|
|
Bugzilla Link |
431 |
Created on |
Jun 02, 2008 18:57 |
Resolution |
DUPLICATE |
Resolved on |
Nov 18, 2009 04:12 |
Version |
1.00beta |
OS |
All |
Architecture |
PC |
Attachments |
error3.sac |
Extended Description
Created an attachment (id=477)
source code
the return types are converted in type conversions BEFORE specializations are done. In case the specializations are triggered by the type checker this is not a problem as any sharpenening of the result tye is inference driven rather than enforced.
However, if specializations are user-enforced this is no longer true, i.e., we have type conversions that are not precise enough.
(rev. 15715)
The attached example reflects this by yielding:
ABORT: line 16 file: error3.sac
ABORT: Component #0 of inferred return type (#32: in [ int[+], int[.]] le <
ABORT: 21 20> ge <>) is not within #21: in [ --, int[.]] le < 20> ge < 32>