|
Revision 6, 392 bytes
(checked in by jcc7, 3 years ago)
|
Made more progress in developing convertToWiki and added some files.
|
| Line | |
|---|
| 1 |
import std.stdio; |
|---|
| 2 |
|
|---|
| 3 |
class Foo |
|---|
| 4 |
{ |
|---|
| 5 |
int x; |
|---|
| 6 |
} |
|---|
| 7 |
|
|---|
| 8 |
void test(Foo foo) |
|---|
| 9 |
{ |
|---|
| 10 |
size_t o; |
|---|
| 11 |
|
|---|
| 12 |
o = Foo.x.offsetof; |
|---|
| 13 |
// error, .offsetof an int type |
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
writefln("%s", o); |
|---|
| 18 |
} |
|---|
| 19 |
|
|---|
| 20 |
void main() |
|---|
| 21 |
{ |
|---|
| 22 |
Foo f = new Foo(); |
|---|
| 23 |
test(f); |
|---|
| 24 |
} |
|---|
| 25 |
|
|---|
| 26 |
/* |
|---|
| 27 |
|
|---|
| 28 |
error.d(12): 'this' is only allowed in non-static member functions |
|---|
| 29 |
error.d(12): this for x needs to be type Foo not type int |
|---|
| 30 |
|
|---|
| 31 |
*/ |
|---|