lucaswerkmeister / ceylon-typesystem-turing-complete

Demonstration that the Ceylon type system is Turing complete
6 stars 0 forks source link

Inferred return type of t is Nothing as of Ceylon 1.3.3 #6

Open AnandA777 opened 6 years ago

AnandA777 commented 6 years ago

Unless I am missing something, the examples in this project are not functioning properly as of Ceylon 1.3.3 for either the JVM or JavaScript. For example, with the notDivisibleByThree, I can compile lines such as:

Accept q3 = t(initial, _3);

The problem appears to be that the inferred return type of t is Nothing, so it can be assigned to anything, including Accept. Similarly, the parentheses-matching and power-of-2 detection examples can't be compiled because the inferred type of t is Nothing, so its results cannot be used as arguments to subsequent calls to t.

Do you know what changed, or if there are any workarounds that still allow similar functionality? Thanks!

lucaswerkmeister commented 6 years ago

Hm, that’s surprising, since I run a version of the Turing machine example in the ceylon.ast tests… I’ll try to look into it when I find the time, thanks for the report!

lucaswerkmeister commented 6 years ago

Could this be ceylon/ceylon.ast@4f34550c7cd8df9b8ed73385f1b2033500f6f3ae? But that was back in 2014…