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
thread 'main' panicked at src/compiler/iml/imlvalue.rs:355:52:
IndexMap: key not found
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The problem is that (T | 'X') is made into an implicit parselet, which references generic T, but T is not a generic of that implicit parselet. Unfortuntately, this issue is a conceptual problem with the current compiler. It cannot be bypassed right now.
The text was updated successfully, but these errors were encountered:
phorward
changed the title
bug: Use of generic within anonymous parselet fails to compile
bug: Use of generic within implicit parselet fails to compile
Jan 18, 2024
phorward
added a commit
to phorward/tokay
that referenced
this issue
Jan 18, 2024
Here are further examples that all produce invalid results. It is a design issue in the compiler's current ImlParselet concept, which requires a deeper and stable rewrite. Tested with Tokay v0.6.6 (a245f24)
Fails with thread 'main' panicked at src/compiler/iml/imlparselet.rs:244:63: called Option::unwrap() on a None value
Double : @<U> {
print("Double ->", *U)
U U
}
Single : @<V> {
print("Single ->", *V)
V | 'X'
}
Test : @<T: 'x'> {
print("Test ->", *T)
Double<Single<T>> print("YES")
}
This version where all generics are named T "runs", but it produces invalid results and is not the wanted behavior.
Double : @<T> {
print("Double ->", *T)
T T
}
Single : @<T> {
print("Single ->", *T)
T | 'X'
}
Test : @<T: 'x'> {
print("Test ->", *T)
Double<Single<T>> print("YES")
}
Test
So this is an example that must work in both cases and should accept the input xx, XX, xX and Xx with YES printed.
Unfortunately I currently don't have the time to face this, but I will do ASAP and when I have an idea for an implementation. Help wanted!
This little program
fails to compile:
The problem is that
(T | 'X')
is made into an implicit parselet, which references generic T, but T is not a generic of that implicit parselet. Unfortuntately, this issue is a conceptual problem with the current compiler. It cannot be bypassed right now.The text was updated successfully, but these errors were encountered: