-
Notifications
You must be signed in to change notification settings - Fork 35
Test is throwing exception: "TypeError: shrink1 is not a function" #227
Comments
I was able to reproduce this by checking out that commit. 👍 When I ran var _elm_community$shrink$Shrink$merge = F3(
function (shrink1, shrink2, a) {
return _elm_community$lazy_list$Lazy_List$unique(
A2(
_elm_community$lazy_list$Lazy_List_ops['+++'],
shrink1(a),
shrink2(a)));
}); This is the only place anything named The offending When I hacked a No idea what the internal structure might be though, or how it managed to get there... 🤔 |
I thought maybe the problem was the Node test runner doing funky hacks, but I tried running this in the HTML runner and it's reproducible there too! I stepped through with the browser dev tools, and the value of Considering Elm doesn't even support a notion of an |
There shouldn't be any native code involved. elm-comidi and elm-test don't have any. If it fails in the HTML runner then that should rule out the Node runner. Does that mean this is an Elm bug or is there some other alternative? |
Definitely seems like an Elm bug to me! |
Marking as "out of scope" to indicate upstream (language) issue. |
Evan commented on Slack:
|
Turns out there are at least two compiler bugs here.
On that branch the tests request The generated {
"elm-community/lazy-list": "1.0.0",
"elm-community/elm-test": "4.2.0",
"mdgriffith/style-elements": "3.4.1",
"elm-community/shrink": "2.0.0",
"elm-lang/virtual-dom": "2.0.4",
"eeue56/elm-lazy": "1.0.0",
"mgold/elm-random-pcg": "5.0.2",
"elm-lang/lazy": "2.0.0",
"eeue56/elm-lazy-list": "1.0.0",
"elm-lang/dom": "1.1.1",
"elm-lang/html": "2.0.0",
"eeue56/elm-shrink": "1.0.0",
"elm-community/html-test-runner": "1.0.6",
"Bogdanp/elm-combine": "3.1.1",
"elm-lang/window": "1.0.1",
"Skinney/murmur3": "2.0.6",
"elm-lang/core": "5.1.1"
} And yet, the code is still clearly calling This is because Here's where the other bug comes in. These custom shrinkers are being built using Indeed, if you remove The bug is specifically that the compiler is okay with Replacing |
Okay, apparently the 0.19 compiler already includes package name as part of type unification, so neither bug should happen anymore. I'm gonna leave this open as a "let's circle back to it and make sure it's no longer reproducible post-0.19," but I don't think any changes are needed on the |
After expanding one of my fuzzers slightly my test began failing because of an exception.
It appears shrink1 is an internal function in elm-test, but I don't know enough about how elm-test works under the hood to know why this might be happening.
Commit that causes crash: rhofour/elm-comidi@0d62c8f
The text was updated successfully, but these errors were encountered: