Skip to content

Conversation

@Stargator
Copy link

No static analysis errors, but I am getting the following error when running the test/run.sh script.

Not sure how to resolve it. I'll look at it later, but any feedback would be appreciated.

Unhandled exception:
type 'Enumeration<dynamic>' is not a subtype of type 'Enumeration<Nil>'
#0      new Enumeration.fix (package:enumerators/src/enumeration.dart:44:22)
#1      fix (package:enumerators/src/enumeration.dart:160:9)
#2      listsOf (package:enumerators/combinators.dart:67:23)
#3      stringsFrom (package:enumerators/combinators.dart:60:22)
#4      strings (package:enumerators/combinators.dart:47:37)
#5      strings (package:enumerators/combinators.dart:47:27)
#6      main (file:///Users/johnmcmahon/Workspace/GitHub/Stargator/enumerators/example/simple.dart:13:23)
#7      _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:279:19)
#8      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)

@Stargator
Copy link
Author

I'm just going to add a try-catch, that will catch the error. I think the error is expected as part of the test.

@polux
Copy link
Owner

polux commented Jul 10, 2018

Hello, thanks a ton! When I check out d8c3f34 and run test/run.sh I end up with the following errors:

  error • The argument type 'BigInt' can't be assigned to the parameter type 'int' at lib/combinators.dart:130:33 • argument_type_not_assignable
  error • The argument type 'BigInt' can't be assigned to the parameter type 'int' at lib/combinators.dart:143:23 • argument_type_not_assignable
  error • The argument type 'BigInt' can't be assigned to the parameter type 'int' at lib/combinators.dart:143:47 • argument_type_not_assignable
3 errors found.

Which doesn't match the stack trace you've pasted earlier. Since then you've made some changes so maybe that's why I'm not seeing the same error.

You mentioned you want to try-catch some error. Is it the one in your first comment or is it the one I'm seeing? Either way I don't think it is expected as part of the test. Or maybe you're talking about a third error?

@polux
Copy link
Owner

polux commented Jul 10, 2018

I just realized that your comment:

I'm just going to add a try-catch, that will catch the error. I think the error is expected as part of the test

maybe refers to polux/propcheck#5 and that you probably mistakenly added it to this pull request instead. Is that the case?

@Stargator
Copy link
Author

@polux I'm pretty sure I posted the correct stacktrace, give me an hour or two and I'll double check the results off of d8c3f34

@Stargator
Copy link
Author

@polux I can confirm that I can reproduce that stacktrace. I'm using Dart 2.0.0-dev.68.0 on a High Sierra Mac.

Unhandled exception:
type 'Enumeration<dynamic>' is not a subtype of type 'Enumeration<Nil>'
#0      new Enumeration.fix (package:enumerators/src/enumeration.dart:44:22)
#1      fix (package:enumerators/src/enumeration.dart:160:9)
#2      listsOf (package:enumerators/combinators.dart:67:23)
#3      stringsFrom (package:enumerators/combinators.dart:60:22)
#4      strings (package:enumerators/combinators.dart:47:37)
#5      strings (package:enumerators/combinators.dart:47:27)
#6      main (file:///Users/johnmcmahon/Workspace/GitHub/Stargator/enumerators/example/simple.dart:13:23)
#7      _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:279:19)
#8      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)

@Stargator
Copy link
Author

But I have a fix incoming for this case, not for the next issue

@Stargator
Copy link
Author

The latest commit now has this error:

Unhandled exception:
type 'Enumeration<dynamic>' is not a subtype of type 'Enumeration<Nil>'
#0      listsOf.<anonymous closure> (package:enumerators/combinators.dart:67:54)
#1      new Enumeration.fix (package:enumerators/src/enumeration.dart:44:21)
#2      fix (package:enumerators/src/enumeration.dart:160:9)
#3      listsOf (package:enumerators/combinators.dart:67:23)
#4      stringsFrom (package:enumerators/combinators.dart:60:22)
#5      strings (package:enumerators/combinators.dart:47:37)
#6      strings (package:enumerators/combinators.dart:47:27)
#7      main (file:///Users/johnmcmahon/Workspace/GitHub/Stargator/enumerators/example/simple.dart:13:23)
#8      _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:279:19)
#9      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)

@Stargator
Copy link
Author

I don't know how to resolve this issue between Enumeration and Enumeration.

It seems to be thrown when the two are suppose to be joined

@polux
Copy link
Owner

polux commented Jul 11, 2018

Indeed, now that I've upgraded to 2.0.0-dev.68.0 I see the same error. I'll look into it.

@polux
Copy link
Owner

polux commented Jul 11, 2018

Ok, I was able to solve that particular problem by adding a type argument to LList, by using apply2 and changing its return type to B, and by changing singleton(nil) with singleton(new Nil<A>() as LList<A>). But now I'm getting another error deep inside the library. Looking at the types I think we're gonna get many of these. The type system of Dart 2 is not super expressive so it's gonna be quite the challenge in some places. I guess we'll end up with a bunch of casts.

I don't know if you'd like to give it a try or if you'd prefer me to merge your PR into a dart 2 branch and then iterate over that branch together. I don't have a lot of free time these days the second option might be slower depending on your speed. @spebbe mentioned he might be willing to help to.

@Stargator
Copy link
Author

Stargator commented Jul 11, 2018

@polux Can you push that fix to my branch so I can work off of it?

I'm fine with working slowly on this as I will be moving this month and so I can check and from time to time. Hopefully, we can build off of each other's work. Especially if @spebbe is interested in helping.

@polux
Copy link
Owner

polux commented Jul 11, 2018

Sorry, I've lost them since I played around. It wasn't much, my comment pretty much describes all the changes I had made.

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

Successfully merging this pull request may close these issues.

2 participants