Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000410OCamlCamlIDLpublic2001-06-27 16:092001-07-30 09:30
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000410: camlidl and union-decl
DescriptionFull_Name: Dmitry Bely
Version: 3.01, camlidl cvs 27.06.01
OS: Windows NT 4.0
Submission from: d009.p3.col.ru (195.210.132.9)


The second form of union-decl (according to p. 2.5 of camlidl manual) does not
work:

[union.idl]
typedef union switch(int ctx)
{
    case 1: int intVal;
    case 2: char charVal;
} UNION;
[end of union.idl]

D:\Work\camlidl-test>camlidl union.idl
union.idl
File union.idl, line 3, character 6: syntax error

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000036)
administrator (administrator)
2001-06-29 09:53

> The second form of union-decl (according to p. 2.5 of camlidl
> manual) does not work:
>
> [union.idl]
> typedef union switch(int ctx)
> {
> case 1: int intVal;
> case 2: char charVal;
> } UNION;

As shown in the manual, each "case" label must syntactically be an
identifier, e.g.

> typedef union switch(int ctx)
> {
> case FIRSTCASE: int intVal;
> case SECONDCASE: char charVal;
> } UNION;

Otherwise, the IDL->Caml mapping cannot guess the Caml constructor
names for each case of the union type.

- Xavier Leroy

(0000037)
administrator (administrator)
2001-06-29 10:30

Behavior conforms to spec.
(0000038)
administrator (administrator)
2001-06-29 12:09

Xavier Leroy <Xavier.Leroy@inria.fr> writes:

> > The second form of union-decl (according to p. 2.5 of camlidl
> > manual) does not work:
> >
> > [union.idl]
> > typedef union switch(int ctx)
> > {
> > case 1: int intVal;
> > case 2: char charVal;
> > } UNION;
>
> As shown in the manual, each "case" label must syntactically be an
> identifier, e.g.
>
> > typedef union switch(int ctx)
> > {
> > case FIRSTCASE: int intVal;
> > case SECONDCASE: char charVal;
> > } UNION;
>
> Otherwise, the IDL->Caml mapping cannot guess the Caml constructor
> names for each case of the union type.

You are right, sorry. I've tried to find out why the following construct
from wtypes.idl generates syntax error (you know, camlidl in fact does not
point to the correct place of error):

typedef union _userCLIPFORMAT switch(long fContext) u
{
    case WDT_INPROC_CALL: DWORD dwValue;
    case WDT_REMOTE_CALL: [string] wchar_t * pwszName;
} userCLIPFORMAT;

and have simplified it in the wrong place. The real problem was that "u"
after switch (don't know what it means for MIDL). Sorry once again.

Hope to hear from you soon,
Dmitry



- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker