dbremner / rubydotnetcompiler

Automatically exported from code.google.com/p/rubydotnetcompiler
0 stars 0 forks source link

@@v = 0; @@v ||= 1 -- should return 0, not 'class variable' #64

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Test case:

  @@v = 0
  puts @@v ||= 1

Expected:

  0

Actual:

  class variable

This is a regression from r150 (fix for issue #59).

Original issue reported on code.google.com by sason...@gmail.com on 1 Nov 2007 at 6:09

GoogleCodeExporter commented 8 years ago
Should be fixed now - fixed the code generation for class variable assignment 
using ||=

Original comment by meaningi...@gmail.com on 1 Nov 2007 at 7:08

GoogleCodeExporter commented 8 years ago
Not really...

  @@v = nil
  puts @@v ||= 1

Expected:

  1

Actual:

  0

Original comment by sason...@gmail.com on 1 Nov 2007 at 8:12

GoogleCodeExporter commented 8 years ago
Sorry, I meant
Actual: nil

Anyway, it's fixed now.

Original comment by sason...@gmail.com on 1 Nov 2007 at 8:17