From 7dba9c850c675cc8066fa3e7c79e836bb7ad8203 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 29 Nov 2010 16:43:36 +0100 Subject: Added 'val' as a type which the 'val' fake keyword must resolve to before val works, as a gesture to make val less 'magical'. It even works, in eclipse. Next up: javac. --- website/features/val.html | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'website') diff --git a/website/features/val.html b/website/features/val.html index a3ce58e0..4e05f8ca 100644 --- a/website/features/val.html +++ b/website/features/val.html @@ -18,6 +18,10 @@ NEW in Lombok 0.10: You can use val as the type of a local variable declaration instead of actually writing the type. When you do this, the type will be inferred from the initializer expression. The local variable will also be made final. This feature works on local variables and on foreach loops only, not on fields. The initializer expression is required. +

+ val is actually a 'type' of sorts, and exists as a real class in the lombok package. You must import it for val to work (or use lombok.val as the type). + The existence of this type on a local variable declaration triggers both the adding of the final keyword as well as copying the type of the initializing expression which overwrites + the 'fake' val type.

WARNING: This feature does not currently work in NetBeans. We're working on fixing that.

-- cgit