Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 381498 - [@Property][@Data] validate that methods can actually be overridden
Summary: [@Property][@Data] validate that methods can actually be overridden
Status: VERIFIED FIXED
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.3.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: v2.7
Keywords:
Depends on: 437498 437501 437508 437509
Blocks:
  Show dependency tree
 
Reported: 2012-06-03 12:12 EDT by Moritz Eysholdt CLA
Modified: 2014-08-28 07:54 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Eysholdt CLA 2012-06-03 12:12:28 EDT
----------- Xtend ----------------
@Data
class DataBug extends Abs {
	int foo
}

class PropertyBug extends Abs {
	@Property int foo
}

abstract class Abs {
	def String getFoo()
}
----------------------------------

The compiled Java code contains errors, because the inferred getters have a different return type than the one from the abstract class. There are no error markers in the Xtend file.
Comment 1 Stefan Oehme CLA 2014-06-26 08:53:54 EDT
Not only the return type is an issue, but the overridden method may also be final.
Comment 2 Stefan Oehme CLA 2014-06-30 08:43:27 EDT
Pushed to review
https://git.eclipse.org/r/#/c/29116/
Comment 3 Stefan Oehme CLA 2014-06-30 08:44:46 EDT
No yet activated for @Property and @Data, as the new validation uses new API that needs the latest nightly to work. Will activate the check in the next few days.