cy99 / shedskin

Automatically exported from code.google.com/p/shedskin
0 stars 0 forks source link

int(x==y) fails to compile #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. shed a python file with these contents:

if __name__=='__main__':
    print int(4==2)

2. run make

What is the expected output? What do you see instead?

expected output is successful compilation, instead I saw:

C:/Documents and Settings/user/Desktop/shedskin/shedskin-
0.0.27/shedskin/lib/builtin.hpp: In function `int __shedskin__::__int(T) 
[with T = bool]':
hmm.cpp:15:   instantiated from here
C:/Documents and Settings/user/Desktop/shedskin/shedskin-
0.0.27/shedskin/lib/builtin.hpp:74: error: base operand of `->' is not a 
pointer
make: *** [hmm.pyd] Error 1

What version of the product are you using? On what operating system?

shedskin 0.0.27
g++ 3.4.2 (mingw-special)
Windows XP SP2

Please provide any additional information below.

This is obviously a terse example of the failure.

Original issue reported on code.google.com by gha...@gmail.com on 6 Mar 2008 at 2:10

GoogleCodeExporter commented 9 years ago
hi greg, thanks for the report!
I fixed this and some related issues in SVN (for example, float(4==2) and 
hex(4==2)
failed, too.) the problem was that the builtins didn't always expect a C++ bool 
type,
which they only get in this kind of situations. thanks again!

Original comment by mark.duf...@gmail.com on 7 Mar 2008 at 11:50