Menu

#217 list comprehension fails without local

None
closed-fixed
None
3
2017-05-24
2017-01-02
No

Not sure what it tripping this actually

procedure main()
    write(image([: 1 to 4 :]))
end

bugged

prompt$ unicon bug-argv.icn -x 
Parsing bug-argv.icn: 
Run-time error 107
File unigram.y; Line 1120
record expected
offending value: &null
Traceback:
   main(list_1 = ["bug-argv.icn"])
   unicon(list_1 = ["bug-argv.icn"]) from line 7 in main.icn
   yyparse() from line 618 in unicon.icn
   action_48() from line 3008 in unigram.icn
   AppendListCompTemps(&null,record treenode_6) from line 438 in unigram.y
   {&null . children} from line 1120 in unigram.y

Works:

procedure main()
    local unrelated
    write(image([: 1 to 4 :]))
end

All it took was adding a completely unrelated local declaration.

prompt$ unicon bug-argv.icn -x
Parsing bug-argv.icn: .
/home/btiffin/inst/langs/unicon-svn/unicon/bin/icont -c   -O bug-argv.icn /tmp/uni80991547
Translating:
bug-argv.icn:
  main
No errors
/home/btiffin/inst/langs/unicon-svn/unicon/bin/icont  bug-argv.u -x
Linking:
Executing:
list_1(4)

Discussion

  • Clinton Jeffery

    Clinton Jeffery - 2017-01-08
    • assigned_to: Clinton Jeffery
    • Group: -->
     
  • Clinton Jeffery

    Clinton Jeffery - 2017-01-12
    • Priority: 5 --> 3
     
  • Clinton Jeffery

    Clinton Jeffery - 2017-01-12

    Compile bugs are generally high priority, and usually simple to fix. Thanks for the report.

     
  • Clinton Jeffery

    Clinton Jeffery - 2017-01-26
    • status: open --> pending-fixed
     
  • Clinton Jeffery

    Clinton Jeffery - 2017-01-26

    Committed tweak to unigram that seems to fix this.

     
  • Jafar

    Jafar - 2017-05-24
    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.