You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the recent Tuple work, I thought I'd finally submit this one that I've had for a while. AFAICT, the first issue below (2k iterations) has already been fixed.
sharedvoidstackOverflowIsSequence() {
variable [Integer*] seq = [];
for (iin0:5k) {
seq = seq.withTrailing(i);
}
// seq is a giant tupleif (is [Integer*] s = (seqofAnything)) {}
/* With 2k iterations: java.lang.RuntimeException: undecidable canonicalization at com.redhat.ceylon.compiler.typechecker.model.ProducedType.resolveAliases(ProducedType.java:2170) at com.redhat.ceylon.compiler.typechecker.model.ProducedType.curriedResolveAliases(ProducedType.java:2220) at com.redhat.ceylon.compiler.typechecker.model.ProducedType.resolveAliases(ProducedType.java:2174) at com.redhat.ceylon.compiler.typechecker.model.ProducedType.curriedResolveAliases(ProducedType.java:2220) at com.redhat.ceylon.compiler.typechecker.model.ProducedType.resolveAliases(ProducedType.java:2174) With 5k iterations: Caused by: java.lang.StackOverflowError at com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor$Nothing.hashCode(TypeDescriptor.java:458) at com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.unorderedHashCode(TypeDescriptor.java:75) at com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor$Union.hashCode(TypeDescriptor.java:556) at java.util.Arrays.hashCode(Arrays.java:3140) at com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor$Class.hashCode(TypeDescriptor.java:182) at java.util.Arrays.hashCode(Arrays.java:3140) at com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor$Class.hashCode(TypeDescriptor.java:182) at java.util.Arrays.hashCode(Arrays.java:3140) at com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor$Class.hashCode(TypeDescriptor.java:182) at java.util.Arrays.hashCode(Arrays.java:3140) */
}
The text was updated successfully, but these errors were encountered:
However, it is painfully slow to use (112 seconds to create 50k 1s with withTrailing, another 112 seconds to sum them with reduce). But I don't think I want to get in the habit of filing performance bugs.
Yeah our tuples aren't actually linked lists, even though they look like they are. Building big tuples with withTrailing() or withLeading() is very inefficient.
(copied verbatim from ceylon/ceylon-compiler#2174)
With the recent
Tuple
work, I thought I'd finally submit this one that I've had for a while. AFAICT, the first issue below (2k iterations) has already been fixed.The text was updated successfully, but these errors were encountered: