Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type issue with counters? #10

Closed
darioush opened this issue May 31, 2013 · 2 comments
Closed

Type issue with counters? #10

darioush opened this issue May 31, 2013 · 2 comments

Comments

@darioush
Copy link

This IR:
method x@1:
method main@5: l1#-4:int
instr 1: enter 0
instr 2: nop
instr 3: wrl
instr 4: ret 0
instr 5: entrypc
instr 6: enter 4
instr 7: count 0
instr 8: count 10
instr 9: ret 0

produces some error when sorting keys to print out.
Class 'String' has no instance method '>'.

NoSuchMethodError : method not found: '>'
Receiver: "0"
Arguments: [10]
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:19:25)
#1 int.< (dart:core-patch/integers.dart:62:18)
#2 int.compareTo (dart:core-patch/integers.dart:107:14)
#3 Comparable.compare.compare (dart:core/comparable.dart:5:64)
#4 Sort.insertionSort_ (dart:_collection-dev/sort.dart:26:34)
#5 Sort._doSort (dart:_collection-dev/sort.dart:15:21)
#6 Sort.sort (dart:_collection-dev/sort.dart:5:12)
#7 IterableMixinWorkaround.sortList (dart:_collection-dev/iterable.dart:753:14)
#8 List.sort (dart:core-patch/growable_array.dart:262:37)
#9 execute (package:start/starti.dart:648:14)
#10 main (file:///home/darioush/git/start/bin/start.dart:45:26)

Therefore, I'm assuming there is some problem with the types.
changing instr 7 to be instr 7: count 00 magically solves the problem but I guess some type is being inferred incorrectly.

@melonhead901
Copy link
Contributor

You can fix it as shown here: melonhead901@c951f9f. Not sure the underlying cause.

On Thu, May 30, 2013 at 6:37 PM, darioush [email protected]
wrote:

This IR:
method x@1:
method main@5: l1#-4:int
instr 1: enter 0
instr 2: nop
instr 3: wrl
instr 4: ret 0
instr 5: entrypc
instr 6: enter 4
instr 7: count 0
instr 8: count 10
instr 9: ret 0
produces some error when sorting keys to print out.
Class 'String' has no instance method '>'.
NoSuchMethodError : method not found: '>'
Receiver: "0"
Arguments: [10]
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:19:25)
#1 int.< (dart:core-patch/integers.dart:62:18)
#2 int.compareTo (dart:core-patch/integers.dart:107:14)
#3 Comparable.compare.compare (dart:core/comparable.dart:5:64)
#4 Sort.insertionSort_ (dart:_collection-dev/sort.dart:26:34)
#5 Sort._doSort (dart:_collection-dev/sort.dart:15:21)
#6 Sort.sort (dart:_collection-dev/sort.dart:5:12)
#7 IterableMixinWorkaround.sortList (dart:_collection-dev/iterable.dart:753:14)
#8 List.sort (dart:core-patch/growable_array.dart:262:37)
#9 execute (package:start/starti.dart:648:14)
#10 main (file:///home/darioush/git/start/bin/start.dart:45:26)
Therefore, I'm assuming there is some problem with the types.

changing instr 7 to be instr 7: count 00 magically solves the problem but I guess some type is being inferred incorrectly.

Reply to this email directly or view it on GitHub:
#10

@vsmenon
Copy link
Owner

vsmenon commented May 31, 2013

I landed a fix: 71ac26c

The problem was due to mixing String and int values in a sort. I put in a custom sort that puts ints ahead of strings regardless of value.

Kellen: I changed some of your logic around quotes - I'm not sure why you were seeing them in the first place. You should see '$' at index 0.

@darioush darioush closed this as completed Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants