Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Error method or field is undefined for the type xxx
Error method or field is undefined for the type xxx [message #1219629] Wed, 04 December 2013 23:38 Go to next message
Eclipse UserFriend
This is probably more of an Eclipse IDE problem. I have only used eclipse with xtext so I'm posting this here.

I am getting an error "method or field is undefined for the type xxx". Even though, it is defined.

The Outline view only shows half the contents of the file, and does not show some of the methods. I also cannot do "Open Declaration" for the referenced methods.

This has happened before but if I add some minor changes and save the file, it goes away. Or if I do a clean rebuild of the project.

But, today, it does not seem to go away. Half of the methods in this file is not being detected by eclipse. Is there a way to fix this?

I have tried restarting eclipse, clean then rebuild, but still the problem persists.

[Updated on: Wed, 04 December 2013 23:49] by Moderator

Re: Error method or field is undefined for the type xxx [message #1219635 is a reply to message #1219629] Thu, 05 December 2013 01:08 Go to previous messageGo to next message
Eclipse UserFriend
Usually when that happened to me it was due to "Unexpected EOF" as the result of some parsing issue. Any useful error/warnings about the place where it stops working?
Re: Error method or field is undefined for the type xxx [message #1219637 is a reply to message #1219629] Thu, 05 December 2013 01:21 Go to previous message
Eclipse UserFriend
Okay. I have fixed my own problem, and found the root cause.

I have these conditional statements
if (x > 1)
   setPrivate(true);
else
   setPrivate(false);


The semicolon causes everything to go crazy. Everything after this method is not shown. I'm using XTEND, and this type of code should be allowed, right?

It will work again if I remove the semicolon, and do this:
if (x > 1)
   setPrivate(true)
else
   setPrivate(false)

[Updated on: Thu, 05 December 2013 01:22] by Moderator

Previous Topic:DSL Formatter does not execute
Next Topic:Class cast exception while running workflow
Goto Forum:
  


Current Time: Tue Jul 08 07:19:07 EDT 2025

Powered by FUDForum. Page generated in 0.05938 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top