Affects Version/s: Scala 2.9.1, Scala 2.9.2
Component/s: Misc Compiler
Windows XP x64 SP2; JDK 1.6.0_21; IntelliJ IDEA 10.5.2; Scala Plugin for IntelliJ 0.4.1491
Okay, this is a weird one. I suspect it's a bug against FSC, but honestly it could be the IntelliJ Scala plugin's fault; I just don't know.
In one file, in src:
In another file, in test:
With FSC disabled, this compiles fine. With FSC on, this complains:
This appears to be a minimal repro to me; the problem goes away if:
- TestClass lives in src as well
- argWithDefault is not used in the for loop
- the outside of the for loop is commented out leaving a bare val _ = argWithDefault
- Inside buggyMethod, I let val argAlias = argWithDefault, and then use argAlias in the for loop
- buggyMethod is defined directly on SadObject rather than in SadTrait
Fortunately, the fourth bullet point is a pretty general workaround for this problem, so I'm not blocked on it... but weird, right?