Introduce SessionData, allow to keep arbitrary data with the session.
Extend RulesListTable with support for invalidation based on rule unique tags.
Introduce UpdatesRecorder to keep track of invalidated nodes.
Extend ApplyTemplatesStep with invalidate logic for typechecking.
Simplify design, drop unnecessary fields, minor refactorings.
Introduced a variation of conversion relation with a bit stricter boxing, needed for eq/neq.
e.g. suppose { (Number n, float f) => n == f } here f shouldn't be boxed.
Everywhere where we don't care whether it's <String> or <string> it will be handled just as String.
Where we need to discern between the cases (as in Recover), 'stringType()' dataform can be matched first.
Remove rules which handle capture+inference var case separately: it's already handled.
Remove rule with error on bound which shouldn't be triggered with new hasBound semantics.
Add symmetric rule for case value+inference var: types can be inferred nevermind relation direction.
Add rules for free vars without bounds (these ain't inference vars). Need in such vars arise when
e.g. params in classifierType terms must be somehow accessed. It's used in MethodCall rules.
During investigation a different issue has been found.
Currently, e.g. when checking args to a method call, if there's an error then inference variable remains free.
It allows to continue typechecking without spurious additional errors triggered by former ones,
but with this approach all relations must gracefully handle free vars, and it's more difficult to avoid "no type".
There's an alternative to always assign to inference var a type at hand, even it doesn't pass checks
-- but then there're more unneccessary errors. Both approaches seem valid, no action is taken now.
Errors are now reported on ClassifierType instead of type argument, because some checks must be done
in captures and there's no proper way to specify origin of arg here.
The tests presumably fail because of a broken contract that is used
in the typesystem implementation, namey that a logical variable
contained by an constraint argument-term (as opposed to being an
argument itself) reactivates the constraint on ground/parent change
event. This assumption is false, thereby the implementation needs
to be adjusted keep compatibility with the contract.
All test data (code) to be contained in j.m.blExt.test module.
The samples are to be kept separately with generation on to demonstrate fewer false negatives
of the new typechecker.
The problem is concerned from incorrect recover of captureType given recent changes to its handling.
Essentially, recover was losing information about inferred type var bounds.
Also, necessary rule for convertsTo for upperBpundType was missing.