Grigorii Kirgizov
145aa79753
Regenerate build.xml for mpscore
2020-04-13 15:10:37 +03:00
Grigorii Kirgizov
bd87873160
Move baseLanguage.tuplesExt lang to 'samples' and upd build script
2020-04-13 14:36:37 +03:00
Grigorii Kirgizov
8dfcff1844
Add typechecking for indexed tuples (new language .tuplesExt and tests)
2020-04-08 23:24:55 +03:00
Fedor Isakov
4e12f7bf3b
Migrate baseLanguageExt sample to new expand/call macros.
2020-03-31 18:44:07 +02:00
Fedor Isakov
6a431fcb49
Rebuild project.
2020-03-31 18:44:07 +02:00
Fedor Isakov
ffcc74459f
Migrate fitch samples to new expand/call macros.
2020-03-31 11:43:30 +02:00
Fedor Isakov
538632a8a3
Migrate lambdacalc sample to new expand/call macros.
2020-03-31 11:43:30 +02:00
Grigorii Kirgizov
79952036cd
Fix ternary operator typechecking
2020-03-26 18:17:06 +03:00
Grigorii Kirgizov
6a53d15a21
Refactor: move logic related to tracking parent match from ControllerImpl to MatchJournal
...
Relates to machinery introduced in MPSCR-47.
Previously parent match was maintained in Controller on Java call stack.
Now this stack of parent matches is maintained manually in MatchJournal.
So MatchJournal gains new invariant: parentChunk()
returns correct parent after each logMatch() call.
Several tests fail, also need to maintain this
invariant after logActivation() calls.
2020-03-26 13:40:41 +03:00
Grigorii Kirgizov
c51d767926
Add typechecking for all missing operators. Refine missing cases, check compatibility. Properly handle ternary op. Add tests. (MPSCR-3)
2020-03-25 20:11:52 +03:00
Grigorii Kirgizov
b6aaec8870
Revert temporary workaround for MPSCR-51 from 16e39a93
2020-03-23 14:39:54 +03:00
Grigorii Kirgizov
91e4d2b582
Revive 'principal' rule feature for MPSCR-51. Mark those rules in BL typesystem.
...
Introduce 'auxiliary/essential' notions instead of 'principal/not principal'.
2020-03-23 14:28:14 +03:00
Grigorii Kirgizov
8874e8eb2c
Complete checking rules for overriding methods (add signature clash check, JLS12 8.4.8). Add tests for that. (MPSCR-3)
2020-03-18 19:50:17 +03:00
Grigorii Kirgizov
7a5a5388b1
minor fix: suppress out of scope error in node test code
2020-03-17 18:36:41 +03:00
Grigorii Kirgizov
16e39a9345
Check applicable scope for certain checking rules in BL (workaround for BL for MPSCR-51). Fix SubclassingUtil.
...
Modified TYPECHECK query to include "checkingScope" query parameter:
it is a root node for which program is generated (for local typechecking it's local node).
Rules additionally match on a constraint `checkDecls(node<>)` bearing this node,
so while rules will be generated for all scopes, only those in applicable scopes will run.
Also split rule for EnumConstantDeclaration on declration checking and just typing rule.
2020-03-17 17:54:38 +03:00
Grigorii Kirgizov
8d1f086562
Rewrite check_ClassifierOverridingMethods checking rule in Coderules. Rename several rules. (MPSCR-3)
2020-03-17 13:14:41 +03:00
Grigorii Kirgizov
455aea18d0
Refactor: compute instantiated subclass paths in SubclassingUtil more efficiently and allow resolving type vars with it
2020-03-16 17:59:19 +03:00
Grigorii Kirgizov
873d04c907
Add typechecking of Enums (MPSCR-3). Also avoid getting Classifier types with prim types as type args
...
Now primitive types in conversion relation are handled before processing of free inference vars.
So primitive types first get boxed and only then these terms can be unified with inference vars.
2020-03-16 16:42:03 +03:00
Grigorii Kirgizov
7c40295948
Add test cases for boxing/unboxing, complete typechecking for boxing (MPSCR-3)
2020-03-12 18:02:21 +03:00
Grigorii Kirgizov
a5cc88aeef
Fix typechecking for qualified this expr (MPSCR-3)
2020-03-12 14:54:40 +03:00
Grigorii Kirgizov
73fd59e58e
Add more test code for checking some cases of BL method overriding logic. Muted for now. (MPSCR-3)
...
It's unclear who should handle this: coderules or old typesystem checking rules.
2020-03-12 14:01:30 +03:00
Grigorii Kirgizov
a2d28e566a
Tried to reproduce MPSCR-50 -- typechecking works okey, problem lies elsewhere
2020-03-12 10:36:26 +03:00
Grigorii Kirgizov
a4d561b5a4
Drop now unused subclassing / promote rules operating on raw Classifier values
2020-03-11 15:51:26 +03:00
Grigorii Kirgizov
88a433584b
Simplify subclassPaths rule, add a test for now used SubclassingUtil's method
...
Previously type substitution in subclssing path is computed
by helper method instead of a code inside rule template.
2020-03-11 15:46:16 +03:00
Grigorii Kirgizov
fea3d5d021
minor: align NestedGenerics test with javac
2020-03-11 15:22:54 +03:00
Grigorii Kirgizov
7b143bdb6f
Ensure typeVarBound constraint is produced once for each tv decl. Fix capture of type var.
...
Fixes typechecking tests.
Type var bounds are produced together with genDecls at program start.
Now bound of type var is captured only when needed --
inside convertsTo check, leaving typeVarBound intact.
2020-03-11 12:29:43 +03:00
Fedor Isakov
253a7609a3
Introduce typeVarBound constraint to handle typevar bounds.
...
Since it's no longer possible to have cyclic terms,
the term for type variable type has to be refactored:
the bound information is attached via typeVarBound constraint
on the type.
2020-03-11 12:29:19 +03:00
Fedor Isakov
4020989bde
Defensive copying of argument list.
...
SModel returns a model-based list by default.
Since it is used w/o a read action, we need to copy the list
to be used as constraint's argument.
2020-03-11 12:28:22 +03:00
Grigorii Kirgizov
e1ac188023
Produce proper type erasure for raw classifiers: type variables are erased to their bounds
2020-03-11 09:41:18 +03:00
Grigorii Kirgizov
d3d567101f
Add typechecking for return type covariance and tests for it (MPSCR-3)
2020-03-11 09:41:08 +03:00
Grigorii Kirgizov
92f95674b3
Refactor: drop meaningless DataForm.asRoot (used symbolPath which is deprecated)
2020-03-06 14:04:18 +03:00
Fedor Isakov
f2bb87e1b0
Apply migration to replace deprecated concept.
2020-02-26 15:03:31 +01:00
Fedor Isakov
7ba7c983cb
Apply migration to use logical variable ref expression.
2020-02-24 22:57:05 +01:00
Fedor Isakov
e1c5f68e3e
Typechecking templates: minor refactoring, optimizing code.
...
Replace node-ptr<> type with node<> where applicable.
Use node<> type is ok in constraint arguments.
Replace instances of LateExpressionItem $() with ExpressionItem.
2020-02-20 14:52:28 +01:00
Fedor Isakov
2c43762f93
Replace all instances of .pointer in constraints to node reference.
...
SNode is supported now directly as an argument to constraint/predicate.
Pointer operation is no longer necessary, as is node-ptr<> type for logical vars.
2020-02-20 11:59:28 +01:00
Fedor Isakov
8ec26b4e94
Support node<> argument in constraints. Prepare to get rid of node-ptr<>. Minor refactoring.
2020-02-20 11:59:28 +01:00
Fedor Isakov
3758971194
Fix the only instance of ExpressionItem that doesn't wrap .pointer op.
2020-02-20 11:59:28 +01:00
Fedor Isakov
9a6859a5d9
Refactor usages of TargetSpec parameter to target{} block.
...
TargetSpec is to be reduced to a reference to logical variable,
simplifying the feedback predicate.
When a node can be specified directly, use target{} block.
2020-02-17 12:49:26 +01:00
Fedor Isakov
417fc45933
Restore origin ref in RuleEx interface, fix terminology in templates API.
...
To avoid confusion, a rule defines "target ref", which is supposed
to indicate the source code location for possible errors.
The origin node is to be referred as "origin" as before.
Temporarily rename OriginSpec's alias to "target" to reflect change
in semantics.
2020-02-17 11:57:14 +01:00
Grigorii Kirgizov
9001286ebe
Add incremental test. Tried reproduce MPSCR-42 with auto-test, but it appeared only from Editor action.
2020-02-13 17:12:33 +03:00
Grigorii Kirgizov
c004ef888a
Avoid producing typeVariable term with null decl inside (MPSCR-40)
2020-02-12 20:24:04 +03:00
Grigorii Kirgizov
2aeadaf63f
Always silently handle wildcard classifiers to avoid errors while handling 'promote' relation (fixes MPSCR-41)
2020-02-12 20:15:07 +03:00
Fedor Isakov
796ad9ad2c
Apply migration to drop ValueOfExpression.
2020-02-12 12:26:09 +01:00
Fedor Isakov
66cf34ae80
Drop instances of ExpressionItem that don't contain a node ref.
...
ExpressionItem is to be ousted. It has no real use aside from
containing a .pointer op.
2020-02-12 10:53:40 +01:00
Grigorii Kirgizov
516ecd594f
Fix incr test failure due to incorrect flow from duplicated line
2020-02-11 16:00:18 +03:00
Grigorii Kirgizov
c87a2741fe
Add test for incrementality in BL to reproduce MPSCR-36
2020-02-11 15:52:30 +03:00
Fedor Isakov
1a6b107a76
Apply migration to replace condition block with if statement.
2020-02-07 13:14:46 +01:00
Fedor Isakov
73219399f4
Deprecate unused flag "principal" in rule template, drop usages.
2020-02-07 12:05:45 +01:00
Fedor Isakov
4a84ebce5f
Apply migration to switch to BodyBlock.
2020-02-06 12:55:32 +01:00
Fedor Isakov
c353f89ea0
Apply migration to drop ParameterContainer.
2020-02-05 17:02:32 +01:00