Bug 153238 - RubyTypeAnalyzer inferencing multiple types
RubyTypeAnalyzer inferencing multiple types
Status: RESOLVED FIXED
Product: ruby
Classification: Unclassified
Component: Editing
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Martin Krauskopf
issues@ruby
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-14 18:44 UTC by Martin Krauskopf
Modified: 2009-02-19 23:02 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Krauskopf 2008-11-14 18:44:05 UTC
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.
Comment 1 Martin Krauskopf 2008-11-14 18:48:11 UTC
More or less STARTED, will continue on Tuesday when back from mountains ;)
Comment 2 Martin Krauskopf 2008-11-21 14:12:34 UTC
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.
Comment 3 Quality Engineering 2008-11-23 17:06:57 UTC
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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo