Commit fe79153
fix(376): rec func "go" was misintrepreting param "ms" (middlewares)
Issue found while trying to run the Star Wars API sample.
Somehow, in the pattern matching branch "None -> go ctx ms", "go" was being
reevaluated to be a function whose ctx parameter is of type unit and the
'res type of the containing function runMiddlewares was being
reevaluated to be IExecutorMiddleware (something like a parameterless ExecutorMiddleware
fetcher), although ctx was clearly initially set to be a
SchemaCompileContext and 'res a "unit" because of the type of the
"compileSchema" function passed as parameter in a later function call.
However, ms is always supposed to be a list of middlewares yet it was
being defined as a generic list, more specifically: the type definition was implicit. By adding
an explicit hint to the compiler in the code that "m" is an IExecutorMiddleware (and therefore "ms" a list thereof),
the compiler no longer had a misinterpretation issue with the recursive "go" function
and the Star Wars API sample now starts successfully.1 parent ad36264 commit fe79153
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
0 commit comments