Commit Graph

838 Commits

Author SHA1 Message Date
Grigorii Kirgizov 955c814c3c Add test for now failing cases of nested generics (filed MPSCR-29) 2019-12-26 19:13:17 +03:00
Grigorii Kirgizov 6399859f8e fix one incorrectly removed rulesList extends 2019-12-26 18:44:17 +03:00
Grigorii Kirgizov 846dbed182 Minor refactor: Split Conversion rulesList to general convertsTo rules and other conversions. Drop intro_hasBound 2019-12-26 18:32:00 +03:00
Grigorii Kirgizov 1b79c2b548 Check compatability for eq/neq operators, forbid null to prim conversion (MPSCR-3)
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.
2019-12-26 17:57:59 +03:00
Grigorii Kirgizov 52af2d527a Complete subtyping for array types (A[] <: Serializable, Cloneable; JLS 4.10.3) (MPSCR-3) 2019-12-25 14:11:01 +03:00
Grigorii Kirgizov e4b927e6e6 stringType: make it a sub-dataform of classifierType, don't add new rules. Add tests for conversion to/from classifierType and binstr promote. (MPSCR-3)
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.
2019-12-25 14:09:48 +03:00
Grigorii Kirgizov 171671161f Remove unused promoteUnchecked rule, add "shortcut" promote_reflexive rule which avoids computing subtype paths 2019-12-24 19:57:46 +03:00
Grigorii Kirgizov a2f8f5e6f3 Handle cases with free & inference variables in containment, remove few unneeded rules (MPSCR-11)
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.
2019-12-24 19:21:33 +03:00
Grigorii Kirgizov 8744263cb4 Add more tests for containment relation, remove some found unsound rules (MPSCR-11)
Rules removed are concerned with type variables. JLS [4.5.1] doesn't define containment for them.
2019-12-24 17:27:52 +03:00
Grigorii Kirgizov 9d35064db5 Provide better explanation of capture/typevar inference rule (relates to MPSCR-13) 2019-12-24 13:54:10 +03:00
Grigorii Kirgizov 76859dc69a Provide required info for return ty inference or assign Object type. Fixes minor MPSCR-27
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.
2019-12-24 13:48:06 +03:00
Grigorii Kirgizov 2a15404753 Disable hasBound_check rule aimed at reactivation. All cases are now handled without it.
Enabling it with working reactivation causes spurious errors on method calls
because now it's impossible to specify feedback target for such errors fired
from reactivated rules.
2019-12-23 21:18:41 +03:00
Grigorii Kirgizov ef5959dcdc Fix failing checkModels test because of var out of scope 2019-12-19 02:42:04 +03:00
Grigorii Kirgizov 455f69f499 Fix miising import of lang.text in tests 2019-12-19 00:59:09 +03:00
Grigorii Kirgizov 3495cb4c2a Fix checking of raw new class / anon class. Thinlet now passes. 2019-12-18 21:47:07 +03:00
Grigorii Kirgizov e8cb6f9ad2 Add rule for determining correct type to bind inference variable to. Fixes MPSCR-13.
The inferred type can be either capture or type variable.
This logic is covered by a new rule 'inferFromCapture'.
For examples see 'Bounds' test sample.

This inference is used in call arguments type inference.
It happens on cases when bounds arise from several places:
 (a) bounds for inference variables from type vars declared in method signature (hasBound constraint)
 (b) bounds of type vars used as arguments to call (typeVariableType term wiht bounds inside)
 (c) bounds from captures on type variables from case (b), which come in the form of 'captureOf' term
2019-12-18 21:47:07 +03:00
Grigorii Kirgizov f2b35764d9 Explicitly match on hasBound in convertsTo rules (it's not reactivated as should) 2019-12-18 21:47:07 +03:00
Grigorii Kirgizov 7d582df9dc Extend and clean up tests for bounds/capture type checking (Bounds sample) 2019-12-18 21:47:07 +03:00
Grigorii Kirgizov 9347cbf8ca Fix captureOf_upperBound_check rule to handle typeVariableType case. Add check for captureOf_lowerBound
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.
2019-12-18 21:47:07 +03:00
Grigorii Kirgizov bced911edf Add tests for capture logic of bl typesystem 2019-12-18 21:47:07 +03:00
Grigorii Kirgizov 4e948ab70e Handle 'cls==null' case in ClassifierType macro. Fixes error in "Typechecking:scopes" test. 2019-12-18 21:47:07 +03:00
Grigorii Kirgizov 6ac8390e77 Remove error feedback from classifierType altogether: always produce some type 2019-12-18 21:47:07 +03:00
Grigorii Kirgizov f51d351e06 Avoid generating checkClsTy rule for ClassifierType-s without model
Workarounds unclear test failure in genericNewExpression with "Unadvised error on 'null/null': ..."
2019-12-18 21:47:07 +03:00
Grigorii Kirgizov b66ba51084 minor: unify instanceMethoCall and baseMethodCall rules so they are almost duplicates
Isn't posssible to merge them because of ClassCreator rule
2019-12-18 21:47:07 +03:00
Grigorii Kirgizov a460459702 Require declared type check for local tc of Expression.
E.g. method calls can rely on it for return type inference.
2019-12-18 21:47:07 +03:00
Grigorii Kirgizov 9138c8e817 Rewrite rules converned with class creation. Add check for args count in ClassifierType check. 2019-12-18 21:47:07 +03:00
Grigorii Kirgizov 489ce56d70 Fix subclassPaths given updated TypeVarSubstitution behavior 2019-12-18 21:47:07 +03:00
Grigorii Kirgizov 85142e52f8 Switch error annotation place on checking classiferi. Correctly handle convertsTo to capture context tvs in instanceMethodCall 2019-12-18 21:47:07 +03:00
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 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
Grigorii Kirgizov 320a19af93 Add test checking precondition for other tests on incrementality
The test is concerned with correct computation of RulesDiff and correct work of ArgumentsCollector
2019-10-31 19:33:17 +03:00
Grigorii Kirgizov 224d998c9a Temporarily comment out a failing line in Samples_bad3 2019-10-28 20:56:56 +03:00
Grigorii Kirgizov 530dfd8719 Fix incorrect vis scopes due to failing coerceTo queries. Assign 'fallback' type in classifierType macro on error to continue typechecking besides returning error.
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.
2019-10-28 20:55:24 +03:00
Grigorii Kirgizov 3016ffd904 Remove dependency on lang.text to enable experimental typechecker for Samples:bounds.bad 2019-10-28 18:33:00 +03:00
Grigorii Kirgizov 223b243e7f MPSCR-2: Fix capture of lowerBoundType on type variables with bounds 2019-10-26 21:44:09 +03:00
Grigorii Kirgizov 820066cf4d Set "do not generate" flags again on some examples in bl tests 2019-10-26 17:11:47 +03:00
Grigorii Kirgizov bc46a8e5ce Upd broken refs to logical vars 2019-10-26 17:01:07 +03:00
Grigorii Kirgizov c16801a928 Remove unnecessary accidental test root for BL 2019-10-26 16:17:41 +03:00
Grigorii Kirgizov 10a4b9ac70 Extend Lub test a bit with intersection type consumer 2019-10-26 16:17:41 +03:00
Grigorii Kirgizov 1b4a5ce55d Add check that all aux boudns in type var decl are interfaces. Add test for such error. 2019-10-26 16:17:37 +03:00
Grigorii Kirgizov 122917cc42 Fix: clean up lub() constraint in one case. Caused typechecker errors. 2019-10-26 16:17:37 +03:00
Grigorii Kirgizov 03702da2f0 Add handling of aux bounds in type variable macros 2019-10-26 16:17:37 +03:00
Grigorii Kirgizov b4d61ecb91 Add two more lub examples in LUB test 2019-10-26 16:17:37 +03:00
Grigorii Kirgizov dfa53a265f Add static field access to Sample typechecking test in BL 2019-10-26 16:16:59 +03:00
Grigorii Kirgizov 8e1633b0fb Fix typing rule for FieldReferenceOperation 2019-10-26 16:16:59 +03:00
Grigorii Kirgizov 9ec95421bf MPSCR-1: Remove unsound rule from containedIn relation. Add test for that case. Restructure Lub tests.
Now another test for suspicious rule for fieldReferenceOperation fails.
2019-10-26 16:16:59 +03:00
Grigorii Kirgizov 223cbeaabe Add incremental test for BL plus operator overload for String type 2019-10-26 16:14:43 +03:00
Fedor Isakov 742adef5f9 Completing BL typesystem: [ClassifierClass,Mul,Div,LT,GT,NEQ]Expression, UnaryMinus. 2019-10-25 22:45:55 +02:00
Fedor Isakov 3092fa3635 Fix all templates with broken scopes for logical variables. 2019-10-25 22:45:55 +02:00
Fedor Isakov a117f52ad5 Various improvements in j.m.baseLanguageExt typesystem.
Introduce generic way of handing recover/2 for ClassifierType.
Extract handling of expectType/2 constraint into a separate ruleslist.
Add lub/3 handler for char type.
2019-10-24 16:29:22 +02:00
Fedor Isakov 2e2cfd5194 Enable generation of samples known to be valid. 2019-10-24 13:29:55 +02:00
Fedor Isakov c81b88f636 Fix Lub test: proove that the result of ternary operation is correct. Enable compilation of "bounds" model. 2019-10-22 21:20:20 +02:00
Fedor Isakov fdd7c7fb19 New language j.m.bl.javadocExt to contain types aspect for javadoc. 2019-10-22 21:20:20 +02:00
Fedor Isakov 94dae1c5a8 Fix buildscript for samples/mpscore (extract dependency). 2019-10-18 17:02:14 +02:00
Grigorii Kirgizov 7fb8ebd7c2 Fix one assert in incremental tests to correctly check nodes with type errors. Fixes last failing test. 2019-10-17 13:17:16 +03:00
Grigorii Kirgizov ef93acd34a Revert "Temporarily silence the last failing BL incrementality test"
This reverts commit 5aa7585b
2019-10-17 12:58:37 +03:00
Grigorii Kirgizov d861fd5eb4 Add convertsTo_ground reflexive case.
At least convertsTo(stringType(), stringType()) was failing without it.
2019-10-17 12:33:17 +03:00
Grigorii Kirgizov 5aa7585bea Temporarily silence the last failing BL incrementality test 2019-10-15 21:31:29 +03:00
Grigorii Kirgizov 0fdc2ada2a Rewrite BL Recover base rules to make dependencies between rules visible (i.e. to actually reeval 'eval' predicates in rules incrementally) 2019-10-15 21:29:07 +03:00
Grigorii Kirgizov 28a82fd443 Revert "Temporarily disable failing tests in BLIncrTypecheck test case."
This reverts commit 1c1ddd6e
2019-10-15 18:01:21 +03:00
Fedor Isakov 6372f5a4a4 Experimental: cache the results of convertsTo/coerceTo queries.
The cache is repository-local and is invalidated on every command in that repository.
2019-10-12 09:35:09 +02:00
Fedor Isakov c7ad048a9e Completing the BL typesystem: rules for Minus- and ParethesizedExpression. 2019-10-12 09:35:09 +02:00
Fedor Isakov 1c1ddd6e5d Temporarily disable failing tests in BLIncrTypecheck test case.
Tests started to fail after an argument was introduced to a constraint that is being
activated from a query -- recoverAll/1 now has a parameter.
2019-10-12 09:35:09 +02:00
Fedor Isakov f8dcf127db Extend typechecking query TYPECHECK with a parameter to report types.
Reporting of calculated types is to be more explicit.
The not-so-obvious _type_.set() operation is to be phased out.
2019-10-10 17:30:11 +02:00
Fedor Isakov be81c982f1 Housekeeping in BL typesystem: organize artifacts using virtual folders. 2019-10-09 13:45:20 +02:00
Fedor Isakov 3d7f8688f5 Add new sample for testing typechecking performance. 2019-10-08 13:30:16 +02:00
Fedor Isakov 9914c3ba19 Add all descendants of classifier type as required. 2019-10-03 10:25:25 +02:00
Fedor Isakov 64a4be471f Optimize typechecking of array literals. The errors are now reported on the literal itself.
In general one should avoid using `typeOf/2` constraint with first argument being a logical.
The indexing mechanism ensures efficient search of matching rules when at least one argument
is a constant value. However, when all arguments are free logicals, *all* matches should be
tested, which is highly ineffective.
2019-09-30 16:44:36 +02:00
Fedor Isakov 7210fd2cad Drop checking for unique varname in BL typesystem. 2019-09-30 16:44:36 +02:00
Fedor Isakov 49518e0704 Switch to reactor version 0.9.14. 2019-09-30 16:44:36 +02:00
Grigorii Kirgizov b362f55b25 Fix error annotations to be on args in method calls tests. Unsilence incremental tests, same arg fix. 2019-09-16 13:56:23 +03:00
Grigorii Kirgizov c0e4bb1d1a Fix reporting on argument nodes in MethodCall rules 2019-09-16 13:56:23 +03:00
Grigorii Kirgizov 51258b5179 Silence two tests on incremental typechecking concerned with method calls 2019-09-16 13:56:23 +03:00
Grigorii Kirgizov ace483a61d Add tests on varargs. Adjust two error annotations. 2019-09-16 13:56:23 +03:00
Grigorii Kirgizov b4f2d88123 Add rules for checking method arguments incl. variable argument 2019-09-16 13:56:23 +03:00
Grigorii Kirgizov d251f626fa Remove Scratchpad that accidentally found its way into test suite 2019-09-16 13:56:23 +03:00
Fedor Isakov 2942c244a6 Move model access out of coderules evaluation, avoid "read access violation".
It's doubtful this check belongs here, but let's keept it for now.
2019-09-13 13:00:03 +02:00
Fedor Isakov 6938a8108b Drop superfluous check involving smodel access.
Typechecker should be occupied with checking types, not the model validation.
2019-09-13 11:31:18 +02:00
Fedor Isakov eda493f672 Fix typechecking of VariableArityType.
Parameter was defined as list instead of child.
2019-09-13 11:28:34 +02:00
Grigorii Kirgizov 332735e770 Remove unneded handler 2019-09-12 15:29:14 +03:00
Grigorii Kirgizov cdfe1f2c0c Update language version after migrations from mps.logic lang 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov a9cf2e5589 Fix inf recursion in recovering intersectionType 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 9a782fc619 Run 'list literal -> cons list constructor' migration on samples 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 39fa007310 Run Splice migration on samples 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 163e339436 Add migration for replacing List usages for ConsList constructor usages 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 1e23572397 minor change of method use in BaseHelper 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 005dfa1e33 Fix reporting for typechecking of arrays in bl 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 6a02be6f6e Avoid nested empty lists in mapped ListNode.Alias. Fix capture in lcta helper for lub. Add test for lub.
The problem with empty lists showed up at least in printing lists.
2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 442d15204c Add capture conversion for type variables produced by LUB 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov a8cb00c8b5 Handle recursive case of LUB: produce wildcard type param 2019-09-11 13:24:02 +03:00
Grigorii Kirgizov 37be72d9cf Refactor generation of ListFeature & 'spliced' MultiMetaLogical. Fix BL typesystem to accomodate these changes.
ListRole in DataForms is stricter and doesn't allow non-list values.
Spliced MultiMetaLogical is always generated to ListNode without intermediate step of Variable[].
2019-09-11 13:24:01 +03:00
Grigorii Kirgizov 4938551fcb Subst ListNode for 'term' type in some places in relation concerned with LUB. Change ListRole to ChildRole in upperBoundType & lowerBoundType. 2019-09-11 13:24:01 +03:00
Grigorii Kirgizov 6255bdb6f5 Add relations required for recursive case of LUB 2019-09-11 13:24:01 +03:00
Grigorii Kirgizov 087bfdaf9b Extend LubHelper to collect all parameterizations of erased types from raw LUB 2019-09-11 13:24:01 +03:00
Grigorii Kirgizov d3186851db Instantiate type variables in extended 'findSubtypePaths' rule 2019-09-11 13:24:01 +03:00
Grigorii Kirgizov e2e531f13c Add few utilities and extend logic of subtypePaths for LUB impl
subtypePaths constraint now has an extended version subtypePathsRaw that returns
extended 'classifierType' dataforms with type parameters (no only classifiers).
2019-09-11 13:24:01 +03:00
Grigorii Kirgizov 0f1460bb67 Add typechecking of array literals handling nested literals
Array literals always belong to some variable decl and their elements
are recursively checked against declared component type [JLS 10.6].
2019-09-11 13:24:01 +03:00
Grigorii Kirgizov 68f6507b72 Fix NPE in kotlin runtime on boolean types with null val from BL 2019-09-11 13:24:01 +03:00
Grigorii Kirgizov 924d07c8ed Return 'tagDetail' logic in RuleBuilder to handle duplicate tags of rules generated in loops 2019-09-11 13:24:01 +03:00
Grigorii Kirgizov ff9d109ea6 Add BL typechecking of arrays and boolean consts. Fails now due to rule tag collisions 2019-09-11 13:24:01 +03:00
Fedor Isakov 5b5798dcad Switch to reactor lib 0.9.13. 2019-09-10 18:37:11 +02:00
Fedor Isakov edc49464e1 Fix the failing test: the error is no longer reported on return statement. 2019-09-02 17:55:46 +02:00
Fedor Isakov 486fbf10af Rewrite error reporting using target spec or by specifying the target. 2019-09-02 17:55:46 +02:00
Fedor Isakov 5eed118be0 Replace usages of deprecated reporting with error constraint.
Having to specify the target for reported messages is a redundancy.
It's better to rely on the built-in feedback mechanism and handle the
messages at the supervisor level.
2019-09-02 17:55:46 +02:00
Fedor Isakov 0db213725e fixup! Swith to using reactor lib 0.9.12. 2019-09-02 17:55:46 +02:00
Fedor Isakov d786ff43b9 Re-save all models, language name updated in .mpl files. 2019-08-20 23:11:19 +02:00
Fedor Isakov 973b9c35d5 Rebuild project. 2019-08-14 13:29:22 +02:00
Fedor Isakov 45ae7a6a24 Fix build script imports and rebuild project. 2019-08-12 18:21:38 +02:00
Fedor Isakov 19b243adf5 Support coerce to concept query in bl types aspect. Testing typechecking in bl. 2019-08-12 16:45:00 +02:00
Fedor Isakov 2ef8adfe5e Switch to reactor 0.9.11 2019-07-30 13:48:08 +02:00
Fedor Isakov 6384085b17 Rebuild project. 2019-07-30 12:24:25 +02:00
Fedor Isakov 3a48c47880 Migration: "update versions in descriptors". 2019-07-30 11:49:26 +02:00
Fedor Isakov 66c9222a95 Run migrations with MPS 2019.2 EAP3. 2019-07-26 17:27:18 +02:00
Fedor Isakov 0f8d858748 Remove unnecessary calls to reactor lifecycle. 2019-07-26 17:18:37 +02:00
Grigorii Kirgizov 11712c7069 Restrict the notion of principal rule (as effect, match journal is shorter now). It also positively affected reporting, so switch reporting to the new way. 2019-07-26 17:00:31 +02:00
Grigorii Kirgizov 9b49c3f053 Fix tests for incremental tc of BL. Add more tests for types with bounds. Temporarily revert reporting method to the old one. 2019-07-26 17:00:31 +02:00
Grigorii Kirgizov ca84b0ae02 Add few more tests on wildcards. 2019-07-26 17:00:31 +02:00
Grigorii Kirgizov 3d80841639 Switch ReportingSupervisor to handle RuleMatch. Add Supervisor using ProgramSpec instead of PrincipalOriginIndex. 2019-07-26 17:00:31 +02:00
Grigorii Kirgizov 78c0cc1559 Setup code for failing typechecking tests, add one. Extract Supervisor impl from ProgramEvaluator. 2019-07-26 17:00:31 +02:00
Grigorii Kirgizov b9309e6369 Add several tests of incr typecheck on BL. ProgramEvaluator now depends on ProgramProducer. 2019-07-26 17:00:31 +02:00
Grigorii Kirgizov b560bbbd30 Separate incremental tests on testlang and baselang into their own models. 2019-07-26 17:00:30 +02:00
Fedor Isakov 79b08c6f83 Revert "Apply migrations from EAP3 and rebuild project."
This reverts commit 9c5bf858c3.
2019-07-26 15:30:30 +02:00
Fedor Isakov 9c5bf858c3 Apply migrations from EAP3 and rebuild project. 2019-07-19 12:28:27 +02:00
Fedor Isakov a0b5acaa62 Rebuild project. 2019-06-07 09:16:21 +02:00
Fedor Isakov 947f9523bd Fix language imports. 2019-06-07 09:16:21 +02:00
Fedor Isakov cd37daaa07 Apply migrations after switching to the latest EAP build of MPS. 2019-06-07 09:16:21 +02:00
Fedor Isakov 17ed4642ae Apply all available automatic migrations. 2019-06-05 16:16:00 +02:00
Fedor Isakov 57de11c3fe Rename all modules/models having prefix j.m.typechecking to j.m.coderules.typechecking. The former is reserved. 2019-06-05 16:15:59 +02:00
Fedor Isakov fe505792c6 A bunch of refactorings and renames in typechecking plugin.
Remove unused interfaces, merge classes with similar functionality, reduce the number of used classes.
2019-06-05 16:14:27 +02:00
Fedor Isakov d0ffcb66ef Regenerated project. 2019-06-05 16:14:27 +02:00
Fedor Isakov 9cd438bbdf New sample in staging model for typechecking test. 2019-06-05 16:09:20 +02:00
Fedor Isakov 3e1c9d6e89 Rebuild project. 2019-06-04 18:59:53 +02:00
Fedor Isakov c11cef9fff Enable back a temporarily disabled test. 2019-05-17 18:01:34 +02:00
Fedor Isakov 1f6fbd0c0f Temporarily disable a test consuming way too much memory, and as
a result failing b/c of a timeout.
2019-05-16 17:43:01 +02:00
Fedor Isakov bd1c56d9d0 Rename concept Handler -> RulesList 2019-05-09 17:30:14 +02:00
Fedor Isakov 478b43ce16 Drop usages of deprecated interfaces. 2019-04-26 00:22:02 +02:00
Fedor Isakov 99ea2a7b71 Switch to the latest revision of reactor lib (0.9.9). 2019-04-24 21:21:03 +02:00
Fedor Isakov 55940d2e16 Remove Kotlin libs from reactor module and from distrib. Rebuild project.
Kotlin runtime is available from the platform.
2019-04-11 11:10:00 +02:00
Fedor Isakov ab006cc8d9 Fix missing dependency. 2019-04-10 09:45:47 +02:00
Fedor Isakov ca0524599d Switch to latest 2019.1 EAP and rebuild. 2019-04-09 16:51:31 +02:00
Fedor Isakov 396b1fdad3 Move all classes from j.m.typechecking to j.m.typechecking.service. This package name is reserved. 2019-03-22 11:40:32 +01:00
Fedor Isakov f6374635bb Rebuild project. 2019-03-22 11:10:08 +01:00
Fedor Isakov 41b15f65c4 Replace assert() constraints with fail() together with an error message. 2019-02-18 12:26:05 +01:00
Fedor Isakov 83e5ce8c26 Switch to the latest conreactor version. 2019-02-15 17:15:16 +01:00
Fedor Isakov fd94f0a249 Straghten up build tasks: assemble to be the default task. Remove superfluous configure_gradle script, use -P switches instead. 2019-02-04 11:32:13 +01:00
Fedor Isakov e0b856634c Add java plugin to all gradle scripts. 2019-02-01 14:15:57 +01:00
Fedor Isakov 38777cda51 Ensure failed test means failed build for all sample projects. 2019-02-01 14:15:04 +01:00
Fedor Isakov ebd4f82514 Specify the value for ${project_home} macrii in sample subprojects. Fix tests being ignored in CI. 2019-02-01 12:08:29 +01:00
Fedor Isakov 5b255f2a02 Fix references and introduce languages engaged on generation to keep compat. w/191 EAP. 2019-02-01 11:31:35 +01:00
Fedor Isakov 080bb0a448 Fix gradle scripts to get rid of deprecated stuff. Default task to build everything without testing. Update INSTALL.txt. 2019-02-01 00:40:59 +01:00
Fedor Isakov 81ee94c342 Fix gradle scripts to ensure model checker is run after everything else has heen built. 2019-01-31 17:39:39 +01:00
Fedor Isakov 9243c00c65 Fix issues found by model checker (ex typesystem). 2019-01-31 11:30:02 +01:00
Fedor Isakov fc1fcaaf9d Cleanup a test: better layout of nested lists. 2019-01-21 11:20:30 +01:00
Fedor Isakov 275070c786 Apply automatic migrations to mpscore subproject 2019-01-13 14:27:38 +01:00
Fedor Isakov f226bea8c2 Minor fixes in the BL typechecking templates. Insert manual new lines in the test structures for better visualization. 2019-01-09 13:01:37 +01:00
Fedor Isakov cc4b335286 Introduce checking for instances of RuntimeErrorType during tests. Refactor test typechecking launcher. 2019-01-04 17:47:44 +01:00
Fedor Isakov 361fff7ec5 Drop usages of ListLiteral in tests. Testing BL typesystem. 2019-01-04 17:47:02 +01:00
Fedor Isakov f855e5fa72 BL typesystem: drop usages of ListLiteral, replace with ListNode. Fix broken type inference of method calls and constructor invocations. A few minor fixes. 2019-01-04 17:46:37 +01:00
Fedor Isakov b5552d5cd3 Cleanup module dependencies 2019-01-03 17:16:47 +01:00
Fedor Isakov 2fd4545be4 BL typechecking: simplifying promote (subclassing relation), implement LUB as raw types intersection, better support for raw classier types 2019-01-03 17:16:47 +01:00
Fedor Isakov 9a99a440ec Testing BL typesystem. Disable Huge test when not in CI. 2019-01-03 17:16:47 +01:00
Fedor Isakov b4693aac3c Switch to the new conreactor version. 2018-12-28 11:57:27 +01:00
Fedor Isakov cb1ea46af7 Typechecking templates: specify data types for logicals that are used for values instead of term. 2018-12-28 11:57:26 +01:00
Fedor Isakov debaa390e2 Tests of BL typechecking features. Primitive types. 2018-12-03 16:59:16 +01:00
Fedor Isakov f0bb068750 Fix instances of removed concepts and broken API calls after migration to 2018.3. Rebuild project. 2018-11-28 16:48:59 +01:00
Fedor Isakov 19ce84f7ef Switch to 2018.3 RC. Apply all migrations. 2018-11-28 16:48:59 +01:00
Fedor Isakov e9d5a05900 Typechecking BL: reimplement type inference, implement and test various missing features. Cleann up and restructure code. 2018-11-28 14:27:51 +01:00
Fedor Isakov 06f95c5870 Update build solution to reflect latest changes. 2018-11-04 13:10:40 +01:00
Fedor Isakov 18fbdbd50b Use error annotation in tests instead of simply relying on typechecking failure. 2018-11-04 13:10:40 +01:00
Fedor Isakov 6788bcf7a1 Switch to latest reactor, update the API calls. Support EvaluationFailure and FailureHandler. 2018-11-04 13:10:40 +01:00
Fedor Isakov 075b34e24d Replacing usages of deprecated concepts. Minor fixes. 2018-09-11 17:01:45 +02:00
Fedor Isakov f12965898f Remove usages of deprecated stuff in typechecking rules. 2018-09-11 15:37:39 +02:00
Fedor Isakov 98dfe30756 Resaved all models 2018-08-03 11:48:36 +02:00
Fedor Isakov d26805db7d Switch to the latest version of reactor lib 0.9.1 2018-08-03 11:48:36 +02:00
Fedor Isakov e2a68b4012 Fixes necessary for compatibility with MPS 2018.2 2018-07-22 16:51:10 +02:00
Fedor Isakov 1cb1472184 Name solutions and models consistently in samples (mpscore). Drop empty obsolete test solution. 2018-07-22 14:48:13 +02:00
Fedor Isakov 0bacffb611 Move type setting operation to typechecking lang. 2018-07-22 11:09:49 +02:00
Fedor Isakov c7cc97fffb Rename reporting runtim solution. 2018-07-21 13:29:40 +02:00
Fedor Isakov ea9919f38a Bring the hierarchy of DataForm concepts in line with the runtime.
Merge DataForm constructors into logic language.
Repackaging logic runtime.
Drop obsolete code.
2018-07-21 13:29:22 +02:00
Fedor Isakov 814baf4bce Update readme files. 2018-07-19 15:12:34 +02:00
Fedor Isakov e29a0576e2 Rename the root project and artifacts to "coderules". 2018-07-18 15:54:52 +02:00
Fedor Isakov 3763f3dfe8 README for mpscore sample. 2018-07-18 11:17:43 +02:00
Fedor Isakov 46b8e5153f Simplify and fix controlflow sample implementation. 2018-07-18 10:42:32 +02:00
Fedor Isakov 63788c9cca Virtual folders for project modules. 2018-07-18 10:42:13 +02:00
Fedor Isakov 8294e8d702 Switch to MPS 2018.1.5 2018-07-17 15:29:02 +02:00
Fedor Isakov 2d3f4126b8 Add a "check" task for testing all projects at once. Switch travis build to 'gradle check'. 2018-07-17 15:09:47 +02:00
Fedor Isakov c12bf0d96a Ensure extracted baseLanguageExt stuff can be built from command line. 2018-07-17 15:09:47 +02:00
Fedor Isakov 473644e389 Extract baseLanguageExt and its related tests to a separate project. 2018-07-16 18:56:36 +02:00
Fedor Isakov 4f6b8a002a Auto-updated descriptors. (Again!) 2018-07-16 16:40:09 +02:00
Fedor Isakov d4477c519b Auto-updated descriptors. 2018-07-16 13:44:02 +02:00
Fedor Isakov 92c6ba3e12 Restructuring the project: consolidate code, moving samples away. 2018-07-14 17:22:07 +02:00