Commit Graph

123 Commits

Author SHA1 Message Date
Grigorii Kirgizov 54fc91a031 Fix and reenable 3 tests on incremental typechecking disabled in fa7532f3, enable few older tests for previously missing bl machinery 2020-02-05 12:29:33 +03:00
Fedor Isakov 5b7bdc5838 Add error annotations on test data where errors are expected. 2020-02-03 12:00:44 +01:00
Fedor Isakov 391c9053b5 Apply migrations after switch to MPS 193. Regenerate project. 2020-02-03 11:24:22 +01:00
Fedor Isakov 5ebdea0714 Add necessary module dependency. 2020-01-20 10:52:40 +01:00
Fedor Isakov fa7532f34f Include origin features's hash to requiredHash when building rules.
This enables to adequately reflect changes in the model when it is updated
by editor actions, such as "side transform".

Three tests was broken as the result of this fix and are disabled
http://127.0.0.1:63320/node?ref=r%3A8d22f6d9-72f0-49ec-92ee-027a87fbedd4%28jetbrains.mps.baseLanguageExt.test.incremental%40tests%29%2F3095008005741803340
2020-01-02 17:42:38 +01:00
Fedor Isakov efd19aa45b Implement incremental generation of coderules program.
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.
2020-01-02 17:20:13 +01:00
Fedor Isakov 1e9e41601a Add method to RuleEx that had been removed from the superclass. 2020-01-02 17:20:13 +01:00
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 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 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 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 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 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 6ac8390e77 Remove error feedback from classifierType altogether: always produce some type 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 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 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 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 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 dbc5154491 Reload and re-generate build scripts. 2019-11-11 15:28:23 +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 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 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 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 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