Open L7R7 opened 4 years ago
Thanks for reporting!
Got it working for this case, also fixed the parser error on deriving
.
The reason why case splitting not works for placeholders for more than one character is the GHCi does not give type info in that case... So it's okay to not show the case split intention in that case.
Can confirm this case works now :+1:
However, I found another case which leads to a non-compiling result:
newtype Base = Base String
newtype PhantomInt a = PhantomInt Int
data BarType = BarType Base (PhantomInt String)
fun :: BarType -> String
fun d = ""
case splits to
fun :: BarType -> String
fun (BarType n (m i)) = ""
I guess the problem is the PhantomInt
newtype. This is probably an edge case, but it's interesting nonetheless. If this type is a parameter of a function the case splitting is not possible. for example:
fun2 :: PhantomInt String -> String
fun2 p = ""
Thanks. Will try to fix the case with the phantom type.
@L7R7
The BarType
case should be fixed in beta81.
https://github.com/rikvdkleij/intellij-haskell/releases/tag/v1.0.0-beta81
The fun2
case is not yet fixed.
Btw, found also an issue with not up-to-date PSI-tree after case-splitting which in beta81 should be solved.
Case splitting works for
newtype
s and plain records, but using it with named fields produces the following: