FIXED: := operator resolving wrong class

Jungle Ide Home Forums Historic logs Fixed Bugs log FIXED: := operator resolving wrong class

This topic contains 5 replies, has 2 voices, and was last updated by  Goodlookinguy 5 years, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #5639

    Goodlookinguy
    Participant

    I don’t think I’ve reported this before, if I have then nevermind. When using the := it will resolve the wrong Node class in the following example.

    
    Function Main:Int()
    	Local map := New StringMap<Int>()
    	Local nodeA := map.FirstNode()
    	Local nodeB:map.Node<String,Int> = map.FirstNode() ' manual way is correct
    	nodeA ' wrong Node class resolved
    End
    
    #5640

    Ziggy
    Keymaster

    It’s a Monkey bug. FirstNode is a private Method and should be producing a compiler error when assigned to nodeA using data type inference. Jungle Ide handles it better and it assumes it is a wrong expression (as, in fact, it is).

    #5653

    Goodlookinguy
    Participant

    FirstNode was un-privitized in Monkey X version 78 at the request of a user. http://www.monkey-x.com/Community/posts.php?topic=8306&post=84253

    #5654

    Ziggy
    Keymaster

    I see, on version 79c, it seems to be getting a list node instead of a map node. Will fix

    #5655

    Ziggy
    Keymaster

    Ok, fixed for next release. It was NOT easy, but it was only affecting data type inference in some very rare scenarios.
    If you need the fix just yet, send me an email and I’ll send it to you.

    #5656

    Goodlookinguy
    Participant

    I can wait for the next version. I’m not in a rush. I’m actually preparing the move relatively soon. So I’m not programming much.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘FIXED: := operator resolving wrong class’ is closed to new replies.