Re: [Vala] delegates in vala
- From: Albert Hopkins <marduk letterboxes org>
- To: vala-list gnome org
- Subject: Re: [Vala] delegates in vala
- Date: Wed, 13 Feb 2013 14:48:48 -0500
On Wed, Feb 13, 2013, at 01:49 PM, Albert Hopkins wrote:
[...]
MyDel del;
...
del = randValue > 50 ? program.PrintLow : program.PrintHigh;
However this gives me a compile error:
delegate.vala:21.32-21.47: error: Assignment: Cannot convert from
`Program.PrintLow' to `Program.PrintLow'
del = randValue < 50 ? program.PrintLow : program.PrintHigh;
^^^^^^^^^^^^^^^^
delegate.vala:21.51-21.67: error: Assignment: Cannot convert from
`Program.PrintHigh' to `Program.PrintHigh'
del = randValue < 50 ? program.PrintLow : program.PrintHigh;
^^^^^^^^^^^^^^^^^
delegate.vala:21.15-21.28: error: Incompatible expressions
del = randValue < 50 ? program.PrintLow : program.PrintHigh;
^^^^^^^^^^^^^^
Compilation failed: 3 error(s), 0 warning(s)
This works:
(randValue < 50)? del = Program.PrintLow: del = Program.PrintHigh;
Although I would like to understand better why the former does not.
-a
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]