eo icon indicating copy to clipboard operation
eo copied to clipboard

Missing attribute `Δ`

Open bugdea1er opened this issue 2 years ago • 2 comments

Object Float has the following definition:

+package org.eolang
+rt jvm org.eolang:eo-runtime:0.0.0

[value] > Float
  # Sum of $ and x
  [x] > add
    Float (^.value.add (x.float.value)) > @
  
# Tests that $ = x
  [x] > eq
    ^.value.eq (x.float.value) > @

  # Converts this to float
  [] > float
    ^ > @

Test with the following line reports error about missing attribute Δ on an object Float:

((Float 4.0).add (Float 5.7)).eq (Float 9.7)

But if we substitute the definition of add attribute explicitly, then somehow the test starts to pass:

(Float ((Float 4.0).value.add ((Float 5.7).float.value))).eq (Float 9.7)

bugdea1er avatar Feb 16 '22 10:02 bugdea1er

@bugdea1er interesting... definitely a bug

yegor256 avatar Mar 11 '22 07:03 yegor256

@bugdea1er can you make this sample somehow smaller? Now it's pretty hard to understand where is the bug.

yegor256 avatar Mar 23 '22 12:03 yegor256

@Graur can you please check this

yegor256 avatar Sep 08 '22 15:09 yegor256