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

mpidl returns error (mpidl: Prelude.undefined) on example input. #32

Open
huangjs opened this issue Jan 11, 2013 · 1 comment
Open

mpidl returns error (mpidl: Prelude.undefined) on example input. #32

huangjs opened this issue Jan 11, 2013 · 1 comment
Labels

Comments

@huangjs
Copy link

huangjs commented Jan 11, 2013

I installed msgpack-idl 0.2.0 using cabal, and tested it using the example in README, however the command quit with code 1 and message: "mpidl: Prelude.undefined".

I tested by outputting both cpp and python, but got same error.

Here's the log:

~/tmp> mpidl cpp -o cpp -n test foo.idl -p
[MPMessage {msgName = "UserInfo", msgParam = [], msgFields = [Field {fldId = 1, fldType = TInt True 32, fldName = "uid", fldDefault = Nothing},Field {fldId = 2, fldType = TString, fldName = "name", fldDefault = Nothing},Field {fldId = 3, fldType = TNullable (TInt True 32), fldName = "flags", fldDefault = Just (LInt 1)}]},MPEnum {enumName = "Sites", enumMem = [(0,"SiteA"),(1,"SiteB"),(2,"SiteC")]},MPMessage {msgName = "LogInLog", msgParam = [], msgFields = [Field {fldId = 1, fldType = TUserDef "UserInfo" [], fldName = "user", fldDefault = Nothing},Field {fldId = 2, fldType = TUserDef "Sites" [], fldName = "site", fldDefault = Nothing}]},MPService {serviceName = "foo", serviceVersion = Nothing, serviceMethods = [Function {methodInherit = False, methodName = "login", methodRetType = TBool, methodArgs = [Field {fldId = 1, fldType = TUserDef "Sites" [], fldName = "site", fldDefault = Nothing},Field {fldId = 2, fldType = TUserDef "UserInfo" [], fldName = "user", fldDefault = Nothing}]}]}]
mpidl: Prelude.undefined

Here's the foo.idl (there was an error on line 19 in the README example):

message UserInfo {
1: int uid
2: string name
3: int? flags = 1
}

enum Sites {
0: SiteA
1: SiteB
2: SiteC
}

message LogInLog {
1: UserInfo user
2: Sites site
}

service foo {
bool login(1: Sites site, 2: UserInfo user)
}

Best,
Jianshi

@noj
Copy link

noj commented Mar 2, 2013

It says in the specification:
field-id specifies an index of serialized array

So, if you change all field ids to start at 0 instead of 1, it will work.

However, when mpidl encounters the nullable field flags in the first message, the C++ generator will fail, since it doesn't handle TNullable.

@hvr hvr added the IDL label Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants