Paul Phillips
2008-06-30 17:33:09 UTC
Is it a bug that this:
var x: String = _
works nicely unless I'm in a try/catch block, in which case
it fails with "error: local variables must be initialized."
This works:
var x: String = null
This however is undesirable for my task, which demands
maximum genericity - i.e. now I have to handle whatever
cases, var i: Int = 0 since null won't fly, etc.
var x: String = _
works nicely unless I'm in a try/catch block, in which case
it fails with "error: local variables must be initialized."
This works:
var x: String = null
This however is undesirable for my task, which demands
maximum genericity - i.e. now I have to handle whatever
cases, var i: Int = 0 since null won't fly, etc.
--
Paul Phillips | Every normal man must be tempted at times
Analgesic | to spit on his hands, hoist the black flag,
Empiricist | and begin to slit throats.
i'll ship a pulp | -- H. L. Mencken
Paul Phillips | Every normal man must be tempted at times
Analgesic | to spit on his hands, hoist the black flag,
Empiricist | and begin to slit throats.
i'll ship a pulp | -- H. L. Mencken