Summary
Allow `the` to override inferred types
Metadata
- Id: 1e9cdca2fa45ff7e92dbb63e2be454f9045d40a5
- Trac id: 1198
- Type: enhancement
- Reporter: evhan
- Owner:
- Cc:
- Status: closed
- Component: scrutinizer
- Estimated difficulty: hard
- Resolution: fixed
- Priority: minor
- Milestone: 4.10.0
- Version: 4.9.x
- Changetime: 2018-04-26 23:59:59 UTC
- Created: 2015-07-05 04:13:54 UTC
- Keywords: types, strict-types, compiler
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).