LibraryBrowser.hx:165: Youth by Isaac Asimov | |
LibraryBrowser.hx:166: null | |
| |
What type does the_book have? Properties only work if the field access is made on a proper type, else the compiler cannot resolve the accessors.
Simon
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
var the_book : Book = getTheBook();
That seems weird though, could you post the related code so we can see what's going on?
Simon
Simon is right. Looks like compiler does nopt know type of "the_book". Try to specify type directly:
var the_book : Book = getTheBook();
Simon is right. Looks like compiler does nopt know type of "the_book". Try to specify type directly:
var the_book : Book = getTheBook();
You received this message because you are subscribed to a topic in the Google Groups "Haxe" group.
Indeed, could you post some code that reproduces the behavior?
Simon
You received this message because you are subscribed to the Google Groups "Haxe" group.
@nadako: can you file an issue if you can reproduce?
Simon
Yes but in cases like var x = 1 it is utterly redundant.
Simon
[Player 3 joined the game]
I'm sorry but I disagree with you. I think it is a very good idea to declare (and initialize) all and every variables.
There might be a guy one day who tries to understand that code and it's a lot of help. That guy can be the same one who wrote the code years before that time :)
On Friday, August 29, 2014 4:13:11 PM UTC+2, Dan Korostelev wrote:
--
You received this message because you are subscribed to the Google Groups "Haxe" group.
Turns out that only fixed half the problem.the_book.name isn't available from within a template.I have a short template like this:<entry><title>::book.name::</title></entry>
The template is being called like this:var out = template.execute({book:the_book});Sys.print(out);
But it prints out like this: <entry><title>null</title></entry>
If I change the template call to this: var out = template.execute({book:the_book, name: the_book.name}) and the template to <entry><title>::name::</title></entry>, I get the expected results. So the_book.name is accessible from within the code, but not the template.
Do templates not have access to properties, if there's no physical field?