This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Then providing union their super-classes in the code-completion, somehow emphasizing intersection over the rest. And bending the whole infrastructure (mainly/only(?) code completion). As a prototype I want to make it work with: var = nil if cond1 var = "some string" var = {:a => 1, :b => 2} else var = [1, 2, 3] end p var.in| # var inferred to { Hash, Array } without { NilClass, String } and e.g.: var = nil if cond1 var = "some string" end p var.in| # var inferred to { NilClass, String } and e.g. var = nil begin var = "some string" end p var.in| # var inferred to { NilClass, String } So few various cases to handle differently.
More or less STARTED, will continue on Tuesday when back from mountains ;)
I hope I did not destroy too much on my first touch in the areas ;) Changeset #c87a5a2c1f16 Message: #153238: RubyTypeAnalyzer inferencing multiple types. Partial IfNode type inference. - to be enhanced about cases presented by RubyTypeAnalyzerTest#FIXME_* methods, need to better cooperate between individual scopes. But still, relatively decent wrt. to real usage. - basic switch of infrastructure to the multiple types inference Changeset #f50d5592e214 Message: When there are more possible types for (assignments to) one variable and one of them cannot be inferred add 'null' to the types collection, i.e. append all 'general' methods. See the test-case for reasoning.
Integrated into 'main-golden', will be available in build *200811231401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/c87a5a2c1f16 User: Martin Krauskopf <mkrauskopf@netbeans.org> Log: #153238: RubyTypeAnalyzer inferencing multiple types. Partial IfNode type inference. - to be enhanced about cases presented by RubyTypeAnalyzerTest#FIXME_* methods, need to better cooperate between individual scopes. But still, relatively decent wrt. to real usage. - basic switch of infrastructure to the multiple types inference