You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Theoretically it should be allowed -- for example the ML type system allows it, too:
Poly/ML 5.2 Release
SOME (SOME 10);
val it = SOME (SOME 10) : int option option
But it probably doesn't occur in practice. dynd-python explicitly disallows it:
Python 3.5.1 |Continuum Analytics, Inc.| (default, Dec 7 2015, 11:16:01)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
from dynd import nd, ndt
a = nd.empty("A * option[?int32]")
Traceback (most recent call last):
File "", line 1, in
File "dynd/nd/array.pyx", line 800, in dynd.nd.array.empty (/home/travis/build/libdynd/dynd-python/build/temp.linux-x86_64-3.5/array.cxx:7592)
File "dynd/ndt/type.pyx", line 122, in dynd.ndt.type.type.cinit (/home/travis/build/libdynd/dynd-python/build/temp.linux-x86_64-3.5/type.cxx:1565)
TypeError: Cannot construct an option type out of ?int32, it is already an option type
I think this should probably be rejected by the parser:
This one is rejected:
I'm not sure if option/questionmark should be exactly equivalent.
The text was updated successfully, but these errors were encountered: