Skip to content

Commit

Permalink
Allow funcs to call rules (finos#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugohills-regnosys authored Sep 29, 2023
1 parent 8a16e5d commit 01f3902
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,6 @@ class RosettaSimpleValidator extends AbstractDeclarativeValidator {
if (targetRule.isLegacy) {
error('''You can only call non-legacy rules.''', ref, null)
}
val containingRule = EcoreUtil2.getContainerOfType(ref, RosettaBlueprint)
if (containingRule === null) {
error('''You can only call a rule from within a rule.''', ref, null)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,25 +253,6 @@ class RosettaValidatorTest implements RosettaIssueCodes {
"Input type of ReportableEvent is not assignable from type number of previous node")
}

@Test
def void cannotCallARuleFromAFunction() {
val model = '''
func Bar:
inputs:
x number (1..1)
output:
result number (1..1)
set result:
Bar2(x)
reporting rule Bar2 from number:
item + item
'''.parseRosetta

model.assertError(ROSETTA_SYMBOL_REFERENCE, null,
"You can only call a rule from within a rule.")
}

@Test
def void canCallARuleFromARule() {
'''
Expand Down

0 comments on commit 01f3902

Please sign in to comment.