Bug 402753 - [typesystem][validation] Misleading warning message when return type cannot be detected
Summary: [typesystem][validation] Misleading warning message when return type cannot b...
Status: NEW
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.4.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-08 10:46 EST by Jan Koehnlein CLA
Modified: 2013-05-27 06:06 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Koehnlein CLA 2013-03-08 10:46:23 EST
In the tortoise DSL in the seven languages I get a warning 
  Cannot infer type from recursive usage. Type 'Object' is used.

on the return type of (class Animator)

def addAnimation(Animation animation) {
   if (isAnimated) {
      animationQueue.add(animation)
      if (!isScheduled && !isStop) {
         schedule(UPDATE_INTERVAL)
         isScheduled = true
         lastStart = System::currentTimeMillis  
      }
   } else {
      animation.set(view.tortoiseFigure, 1)
   }
}

even though there is no recursion involved. So at least the warning message is bogus. 'animation.set()' returns void. Doesn't an 'if' without an 'else' return 'void', too?

Given there was no error with the old TS, this is a regression. Unfortunately, I could not figure out an easier example. Interestingly, the marker is grayed out and stays that way if the editor is saved, but seems to be re-added by the builder only.
Comment 1 Sebastian Zarnekow CLA 2013-03-11 04:13:27 EDT
This is caused by a cyclic dependency between TortoiseView and Animator.

Recursion / cyclic resolution will be improved in M7
Comment 2 Jan Koehnlein CLA 2013-05-27 04:33:59 EDT
Still an issue.