Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type definition using "type" is not properly resolved when used #355

Open
dumblob opened this issue Jan 28, 2015 · 3 comments
Open

Type definition using "type" is not properly resolved when used #355

dumblob opened this issue Jan 28, 2015 · 3 comments

Comments

@dumblob
Copy link

dumblob commented Jan 28, 2015

0$ dao -e '{(tuple<int, int>)(0, 1), (3, 2)}.iterate{io.writeln(X)}'
( 0, 1 )
( 3, 2 )
= none
0$ dao -e 'type T = tuple<int, int>; {(T)(0, 1), (3, 2)}.iterate{io.writeln(X)}'
[[ERROR]] in file "command line codes":
  At line 1 : Invalid expression --- " .iterate{io. writeln(X)} ";
1$ 
@dumblob
Copy link
Author

dumblob commented Jan 29, 2015

I'd also expect casting working over newlines:

0$ cat ~/del/a.dao
{
  (tuple<string, string>) ('a', 'b'),
}.iterate { io.writeln(X) }
0$ dao ~/del/a.dao
( "a", "b" )
0$ cat ~/del/b.dao
{
  (tuple<string, string>)
  ('a', 'b'),
}.iterate { io.writeln(X) }
0$ dao ~/del/a.dao
[[ERROR]] in file "/home/test/del/b.dao":
  At line 2 : Invalid expression --- " (tuple<string, string>) ";
  At line 2 : Invalid expression --- " tuple<string, string>) ";
  At line 2 : Symbol not defined --- " tuple ";
1$ 

@dumblob
Copy link
Author

dumblob commented Jan 29, 2015

And there is mismatch in reporting an issue in code sections:

0$ cat syntax_err.dao
{
  (a="sth0", b=7),
  (a="sth1", b=8),
}.iterate {
  # ... whatever code here
  io.writeln(
    'abc' + X.a @[]def@[]
  )
}
0$ dao syntax_err.dao 
[[ERROR]] in file "/home/test/syntax_err.dao":
  At line 2 : Invalid expression --- " }.iterate { ";

@dumblob
Copy link
Author

dumblob commented Apr 13, 2019

The first issue type T = tuple<int, int>; {(T)(0, 1), (3, 2)}.iterate{io.writeln(X)} is already solved and seems to work. The other two issues persist 😉.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant