Commit Graph

385 Commits

Author SHA1 Message Date
Grigorii Kirgizov be2bb09811 Remove incorrect convertsTo rule (any to upperBoundType can't be converted) 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 76c6ee052a Switch error reporting on arg types from 'origin' to 'convertsToSafe' in method call rules.
'origin' works only when wrapping whole ConstraintRule-s, not individual constraint activation statements.
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov b0c0f1b118 Remove unneded constraint toTypeVariableType 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov e13ca7ad33 Make TypeVarSubs usage precondition weaker: don't require substs for declared vars to be set. Drop vacuous type var resolution. 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 2e0feb670e Fix baseMethodCall rule accroding to instanceMethodCallOperation rule 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 62d76dea9f Check type arguments on instanceMethodCall. Rename captureWildcard to captureBound 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov dc6ffbdbad Fix forwarding to GenericDeclaration macro by using 'call' instead of expand. Check mismatched num of args in ClassifierType. 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov a887328d4a Process case of convertsTo(X,T) when isFree(X) in priority to correctly bind inference vars.
Fixes case described in MPSCR-13, but not all tests now pass.
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov af14f31090 Handle capture for bounds of type var types. Add additional example for that case in Samples_bad2 (MPSCR-13) 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 6305578b25 Simplify captureWildcard by using tv bounds from type scheme instead of hasBound. Fix inferring bounds for captures.
Concerned with MPSCR-13 and MPSCR-16.
Previous decision that bounds on lowerBoundType must be "refined" (see 'capture' rulesList) proved to be wrong.
The source of typesystem errors is that capture isn't performed properly on arguments which has type variable type.
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 52f708908b Fix captureWildcard to correctly work with hasBound and type vars. Produce hasBound where needed. (MPSCR-16) 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov f33d94dead Add default classifierType macro expansion for ThisExpression. Fix calls to this macro. (MPSCR-16) 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 99d386c3ef Switch Capture from using TVSubs to type scheme instantiation. Fix checking clsType. (MPSCR-16) 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 0604a69789 Remove older versions of rules and macros for generics. Introduce additional Typecheck stage of "checkGenerics". (MPSCR-16) 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 31dd2a3644 Handle raw & unparameterized classifiers in new macros (MPSCR-16) 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 6f5746a31d Extract checks from macros to separate rules. Add notion of typeScheme (genDecl dataform). Remove type inference logic from capture. (MPSCR-16) 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 78358bfc1c Partly rework 'capture' given new hasBound semantics. Produce hasBound in typeVariable macro for Object bound too. (MPSCR-16) 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 8a2aa76252 Allow default type var decl expansion to typeVariableType() in classifierType macro (MPSCR-16)
e.g. needed for ThisExpression
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov c3aba49059 Fix PathHelper to pass a test for SubtypePaths which uses raw types in subclass paths 2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 0e4e6fe8df Redefine typeVariableDeclaration macro. Use TypeVariableSubstitution more consistently (MPSCR-16). Fix SubclassPaths.
'typeVariableDeclaration' now returns substituted vars or creates new subst.
Earlier it created created a new susbst which led to infinite recursion in specific cases.
Now macro expects tvdecl to be declared in TypeVariableSubstitution.
Accordingly modify usages of TypeVariableSubstitution.

Also fix (apparently broken?) SubclassPaths rulesList (used in lub relation)
and switch 'dpromote' implementation to use it
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 0bc053fe63 Fix classifierType macro condition, fix typeVariable macro & add tmp forwarding macros (MPSCR-16)
Macros currently don't handle subconcepts expansions.
2019-12-18 21:47:06 +03:00
Grigorii Kirgizov 2a71743895 Handle cases when inference variables must be instantiated into typeVariableType (MPSCR-16) 2019-12-18 21:47:05 +03:00
Grigorii Kirgizov c8d1b9415b Clean rules in hasBound rulesList (MPSCR-16)
Most of the rules were duplicating rules from convertsTo
2019-12-18 21:47:05 +03:00
Grigorii Kirgizov 9fbda2b26d Change subset of calls to ClassifierType macro to expansion of Classifier macro (MPSCR-16) 2019-12-18 21:47:05 +03:00
Grigorii Kirgizov 0b3354cf24 Move 'cls==null' case to Classifier macro from ClassifierType macro (MPSCR-16) 2019-12-18 21:47:05 +03:00
Grigorii Kirgizov 9a31800dfa Refactor classifierType macro in ReferenceTypes macro table (MPSCR-16) 2019-12-18 21:47:05 +03:00
Grigorii Kirgizov 13de18ae90 Change calls to typeVariable macro to macro expansions (of TypeVariableDeclaration) (MPSCR-16) 2019-12-18 21:47:05 +03:00
Grigorii Kirgizov 749ac192aa Begin work on MPSCR-16: rewrite macros for TypeVariableDeclaration & TypeVariableReference
Remove duplicated processing of auxiliary bounds in type var declarations.
TypeVariableDeclaration macro now plays a role of instantiating type variables.
hasBound constraint is produced more consistently, on any expansion of TypeVariableDeclaration.
It will work mainly through reactivation due to changes to its arguments.
2019-12-18 21:47:05 +03:00
Grigorii Kirgizov fa129f5937 Add test case for capture & containment. One case fails. 2019-12-18 21:47:05 +03:00
Fedor Isakov dfecccfb86 Fixup ArgumentsCollector: include forgotten model changes, fix the build. 2019-12-11 12:00:51 +01:00
Fedor Isakov 7c781a7f87 Add javadocExt language to the build script.
Rename javadocExt language's location.
2019-12-08 21:36:51 +01:00
Fedor Isakov eb50ce7f86 Typechecking BL: optimize matching list with arguments.
Checking for triggering condition in guard is ineffective.
Pattern matching is faster.
2019-12-08 17:51:41 +01:00
Fedor Isakov b182cf60d7 Revert "Temporarily ignore failing tests."
This reverts commit 7776f97fe7.
2019-11-26 23:09:40 +01:00
Fedor Isakov 85674ef077 Add explicit "test" facets to test solutions. 2019-11-24 17:58:15 +01:00
Fedor Isakov 7776f97fe7 Temporarily ignore failing tests.
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.
2019-11-24 13:34:59 +01:00
Fedor Isakov 96fbab18b4 Fix dependencies of blExt and javadocExt langs.
The dependency on j.m.l.typechecking lang must be kept on the module level.
2019-11-24 13:34:59 +01:00
Fedor Isakov 8fdd80c54e Restore accidentally remove language import. Fix the tests. 2019-11-11 16:58:00 +01:00
Fedor Isakov dbc5154491 Reload and re-generate build scripts. 2019-11-11 15:28:23 +01:00
Fedor Isakov 69bc34e8f9 Drop language j.m.l.smodel.types containing SNodeTypeOp that is no longer used. 2019-11-11 14:37:41 +01:00
Fedor Isakov ecd2594fed Drop deprecated Reporting interface and all its usages.
Remove runtime solution that contained only Reporting.
2019-11-11 13:53:41 +01:00
Fedor Isakov 96f45c6e37 Drop commented out code. 2019-11-11 12:20:12 +01:00
Fedor Isakov 1e068abe13 Repackage typechecking tests to separate module.
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.
2019-11-06 21:14:12 +01:00
Fedor Isakov 3f1b65ada2 Fix the structural errors introduced by a badly run migration. 2019-11-06 12:05:18 +01:00
Fedor Isakov ad90a4cb77 Apply migration that replaces all instances of NodeAnchor with .pointer op. 2019-11-06 11:21:57 +01:00
Fedor Isakov daa1bdceb6 Update default jvm options for running tests to "-Xmx2048m". 2019-11-05 20:53:01 +01:00
Fedor Isakov 15a7dece1b Move error annotation to the correct place in test samples. 2019-11-05 18:55:08 +01:00
Fedor Isakov 9f3301f1c2 Typechecking BL: Use origin block to suppress target for dpromote solvers. 2019-11-05 18:54:38 +01:00
Fedor Isakov 8d21b056fa Typechecking BL: drop calls to node-ptr.resolve where not necessary.
Replace expand macro with plain term constructors for String and Object.
2019-11-04 17:16:45 +01:00
Fedor Isakov 0585f88496 Suppress a scope error in a "bad" sample. 2019-11-04 16:20:57 +01:00
Fedor Isakov 4396adc9ff Fix error being reported on another location. 2019-11-04 16:20:57 +01:00