Project

General

Profile

Bug #1089

Variables scope lookup is flawed

Added by Anonymous almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
-
Start date:
12/18/2012
Due date:
% Done:

100%

Estimated time:

Description

- create a component A with an input port a of type int
- create a subcomponent of A called B with an input port b
- in B create a state machine with a transition. In this transition it is allowed to write as guard "a == 1" (even if component B does not have any port called 'a')

The problem is that the lookup of variables definitions does not stop at the boundaries of components.

AF3-Project.af3_23 (9.07 KB) AF3-Project.af3_23 Florian Hölzl, 01/14/2013 04:48 PM

History

#1 Updated by Anonymous almost 8 years ago

  • Status changed from New to Resolved

#2 Updated by Anonymous almost 8 years ago

  • Assignee changed from Anonymous to Florian Hölzl

#3 Updated by Anonymous almost 8 years ago

  • % Done changed from 0 to 90

#4 Updated by Florian Hölzl almost 8 years ago

  • File AF3-Project.af3_23 AF3-Project.af3_23 added
  • Status changed from Resolved to In Progress
  • Assignee changed from Florian Hölzl to Anonymous
  • Priority changed from Urgent to High

This use case now leads to a type checker exception (see attached model).

java.lang.IllegalArgumentException: Cannot determine the type of Output
at org.fortiss.af3.expression.language.TypeChecker.getType(TypeChecker.java:525)
at org.fortiss.af3.expression.language.TypeChecker.typecheckStatement(TypeChecker.java:211)
at org.fortiss.af3.expression.language.TypeChecker.typecheckStatement(TypeChecker.java:193)
at org.fortiss.af3.expression.language.TypeChecker.typecheck(TypeChecker.java:93)
at org.fortiss.af3.component.constraint.TypeCheckConstraintCheckerBase.collectViolations(TypeCheckConstraintCheckerBase.java:87)
at org.fortiss.tooling.kernel.extension.base.MultiViolationConstraintCheckerBase.apply(MultiViolationConstraintCheckerBase.java:49)
at org.fortiss.tooling.kernel.internal.ConstraintCheckerService.performConstraintCheck(ConstraintCheckerService.java:92)
at org.fortiss.tooling.kernel.internal.ConstraintCheckerService.performAllConstraintChecksRecursively(ConstraintCheckerService.java:61)
at org.fortiss.tooling.kernel.ui.internal.MarkerService.refreshMarkers(MarkerService.java:187)
at org.fortiss.tooling.kernel.ui.internal.MarkerService$2.run(MarkerService.java:117)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

#5 Updated by Anonymous almost 8 years ago

  • Status changed from In Progress to Feedback

the exception is thrown correctly. Because the output port of CAR2->Component34->Component is called Output23 and referenced with name Output in the CodeSpecification. After renamed the output port, the exception is gone.

#6 Updated by Anonymous almost 8 years ago

  • Assignee changed from Anonymous to Anonymous

#7 Updated by Anonymous almost 8 years ago

  • Status changed from Feedback to Closed

Moudy was right, the model is error prone - now the lookup seems to work, so I close this issue

#8 Updated by Anonymous almost 8 years ago

  • % Done changed from 90 to 100

Also available in: Atom PDF