Summary

Allow `the` to override inferred types

Metadata

Description

`the` can currently specialize an expression's inferred type to a more specific one, but it can't also generalize it to a less specific one when -strict-types is used (an error is signaled during compilation when the declared type is more general than the inferred type):

 Warning: in toplevel procedure `foo?':
   expression returns a result of type `fixnum', but is declared to return `number', which is not a subtype
 
 Error: some variable types do not satisfy strictness

This would be useful for the purpose described in this thread (specifically here).

Changes and comments

[2016-08-25 21:47:53 UTC] sjamaan set difficulty to hard

[2018-04-26 23:59:59 UTC] evhan changed status from new to closed

[2018-04-26 23:59:59 UTC] evhan set resolution to fixed

[2018-04-26 23:59:59 UTC] evhan changed milestone from someday to 4.10.0

[2018-04-26 23:59:59 UTC] evhan wrote:

This was fixed long ago in 7f928ac2 (master) and 1939cbb9 (chicken-4).