diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/check/CollectDeclaration.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/check/CollectDeclaration.rsc index 54391f6b..def15d7f 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/CollectDeclaration.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/CollectDeclaration.rsc @@ -143,7 +143,7 @@ void collect(current: (Declaration) ` anno "); if(!isEmpty(tagsMap)) dt.tags = tagsMap; c.define(pname, annoId(), name, dt); - collect(annoType, onType, c); + collect(tags, annoType, onType, c); } // ---- keyword Formal -------------------------------------------------------- @@ -223,7 +223,7 @@ void collect(current: (FunctionDeclaration) ``, Collec c.enterLubScope(decl); scope = c.getScope(); c.setScopeInfo(scope, functionScope(), returnInfo(signature.\type)); - collect(decl.signature, c); + collect(decl.tags, decl.signature, c); // DefInfo dt = noDefInfo(); // try { // try immediate computation of the function type if all types are already available @@ -651,7 +651,7 @@ void collect (current: (Declaration) ` alias c.define(aliasName, aliasId(), current, defType([base], AType(Solver s) { return s.getType(base); })[md5 = md5Hash("")]); c.enterScope(current); - collect(base, c); + collect(tags, base, c); c.leaveScope(current); } @@ -685,5 +685,5 @@ void collect (current: (Declaration) ` alias return aalias(aliasName, params, s.getType(base)); })[md5 = md5Hash("")]); - collect(typeVars + base, c); + collect(tags, typeVars + base, c); } \ No newline at end of file diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/check/CollectOperators.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/check/CollectOperators.rsc index ed067e36..a98e9b8c 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/CollectOperators.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/CollectOperators.rsc @@ -805,17 +805,18 @@ void collect(current: (Expression) ` || `, Colle s.requireUnify(abool(), rhs, error(rhs, "Argument of || should be `bool`, found %t", rhs)); }); - collect(lhs, c); - introLhs = introducedVars(lhs, c); introRhs = introducedVars(rhs, c); + + collect(lhs, c); // make common variables available when collecting rhs; // variables in rhs will use definition from lhs (see CollectPattern: typed variable pattern, qualifiedName pattern) c.setScopeInfo(c.getScope(), orScope(), orInfo(introLhs)); collect(rhs, c); - // Check that the names introduced in lhs and rhs are the same + // Check that the names introduced in lhs and rhs are the same + common = introLhs & introRhs; missing = (introLhs - common) + (introRhs - common); diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst5.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst5.rsc index e1bc1485..2044c473 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst5.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst5.rsc @@ -25,19 +25,10 @@ module lang::rascalcore::compile::Examples::Tst5 // && x == "x" && y == "y"; //} -@synopsis{Sort the elements of a list.} - -list[&T] sort(list[&T] lst) = - sort(lst, bool (&T a, &T b) { return a < b; } ); - -@javaClass{org.rascalmpl.library.Prelude} -java list[&T] sort(list[&T] l, bool (&T a, &T b) less) ; - -value main(){ - myList = [<1,2>,<2,2>]; - return sort(myList, bool (, ) { return i < j; }); -} +import util::Memo; +@memo=expireAfter(minutes=10) +void foo() { } //value main(){ // if([1, int x] !:= [1]) return x;