Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360738 - validation isn't validating assigning null to non-nullable variable
Summary: validation isn't validating assigning null to non-nullable variable
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-12 17:50 EDT by Jing Qian CLA
Modified: 2017-02-23 14:16 EST (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 Jing Qian CLA 2011-10-12 17:50:20 EDT
I have the following code

function myF() 
   s String;
   s = null;

   a String[];
   a = null;
end

right now, validation gives me validation error on a, saying can't assign null to non nullable, which is good, but it should also give me the same validation error on s = null
Comment 1 Paul Harmon CLA 2011-10-13 11:50:52 EDT
I have updated AssignmentStatementValidator to fix this. When I originally added the validation, I thought that this rule only applied to reference types. Matt confirms that this is not valid for value types as well.
Comment 2 Jing Qian CLA 2011-11-11 15:19:12 EST
verified on 2011/11/11/0901's build