Illegal dynamic reference: State in dynamic input task
See original GitHub issuesteps
Compile this code under sbt 1.0.0
private def testState: Def.Initialize[InputTask[Unit]] =
Def.inputTaskDyn {
someFunc(someParser.parsed, state.value)
}
problem
It throws Illegal dynamic reference: State
, but under 0.13.16 sbt everything is alright
expectation
Normal compilation as in sbt 0.13.16
sbt version: 1.0.0
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:11 (9 by maintainers)
Top Results From Across the Web
sbt illegal dynamic reference in runMain - Stack Overflow
The dynamic variable file is used as the argument of toTask , which the current macro implementation prohibits. Why static? Sbt forces task...
Read more >Defining a dynamic input task with Def.inputTaskDyn - SBT
Here's how we can sequence a task after an input tasks. ... the continuation task, simply rewiring runopen to Compile / run will...
Read more >Paths - AWS Step Functions
Reference Paths. A reference path is a path whose syntax is limited in such a way that it can identify only a single...
Read more >[Solved]-sbt illegal dynamic reference in runMain-scala
The dynamic variable file is used as the argument of toTask , which the current macro implementation prohibits. Why static? Sbt forces task...
Read more >Troubleshooting Simulation Errors - MATLAB & Simulink
If you get an error message about a missing reference block, or node, ... Simscape solver can handle dependencies among dynamic states that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @vovapolu, I’ll see if I can identify how this regressed.
Using directly the helpers that the
Def.inputTaskDyn
macro code would emit if there was no false positives seems to work and to be portable across sbt 0.13.x and sbt 1.x https://github.com/sbt/sbt/blob/b18140c14b1e5fa72e2709576aede414298c3f91/main-settings/src/main/scala/sbt/InputTask.scala#L93-L100Example of replacing the workaround mentioned just above with that: https://github.com/scalacenter/sbt-scalafix/pull/126/commits/2ca68e4f38cc39d5a7cdd32658e69bcad9d5b6ca#diff-b6db8e3499369917214568aee2dd0960R168