ngs-doo / revenj

DSL Platform compatible backend
https://dsl-platform.com
BSD 3-Clause "New" or "Revised" License
268 stars 44 forks source link

Compilation error with nullable enum and snowflake #110

Closed Kobus-Smit closed 6 years ago

Kobus-Smit commented 6 years ago

Client library does not compile for this dsl: (Compiler: 2.1.6782.13569)

module test {

root transaction {
  timestamp timestamp;
  string? currency_id;
  currency_type? currency_type;   // ERROR

  relationship currency_rel(currency_id, currency_type) currency;

  has mapping from_view from transaction_view;
  has mapping to_view   into transaction_view;
}

snowflake<transaction> transaction_view {
  timestamp;
  currency_id;
  currency_type;
}

root currency(id, type) {
  string id;
  currency_type type;
  string name;
}

enum currency_type {                  
  fiat;
  crypto;
}     

mapping from_view;
mapping to_view;

}
Error during compilation:
Cannot implicitly convert type 'test.currency_type?' to 'test.currency_type'. An explicit conversion exists (are you missing a cast?)

image

zapov commented 6 years ago

Tnx for the bug report. It should be fixed now.

Kobus-Smit commented 6 years ago

Thanks @zapov