eclipse / xtext

Eclipse Xtext™ is a language development framework

Home Page:http://www.eclipse.org/Xtext

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Xtend: Strange error message for `void` as a field type

LorenzoBettini opened this issue · comments

When you use void for an Xtend field the error message is

Primitive void cannot be a dependency.

Coming from XtendValidator

	@Check
	public void checkNoVoidInDependencyDeclaration(XtendField dep) {
		JvmTypeReference declaredFieldType = dep.getType();
		if (isPrimitiveVoid(declaredFieldType)) {
			error("Primitive void cannot be a dependency.", dep.getType(), null, INVALID_USE_OF_TYPE);
		}
	}

Why not something similar to parameters' corresponding error message void is an invalid type for the field...

@szarnekow

You're right, this is very poor feedback and dates back to one of the first versions of Xtend. Please make the necessary adjustments to improve the message.