January 25, 2004 bug? cannot implicitly convert int() to int | ||||
|---|---|---|---|---|
| ||||
The following code produces: "cannot implicitly convert int() to int".
import std.c.stdio;
struct A {
int b() { return 1; }
}
int x() {
A a;
return a.b;
}
void main () {
printf("%d\n",x());
}
I know I can make work doing "return a.b();", but what would be the purpose
of properties then?
-----------------------
Carlos Santander Bernal
| ||||
January 26, 2004 Re: bug? cannot implicitly convert int() to int | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | Carlos Santander B. wrote:
[...]
> I know I can make work doing "return a.b();", but what would be
> the purpose of properties then?
It also works with `return a.b + 0;'.
Even the example in the docs does not compile, when the `+ 3' is deleted.
So long.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply