Skip to content

Several changes on RTTI metadata for Python target#192

Merged
dahlia merged 3 commits intonirum-lang:masterfrom
dahlia:__nirum_type__
Nov 6, 2017
Merged

Several changes on RTTI metadata for Python target#192
dahlia merged 3 commits intonirum-lang:masterfrom
dahlia:__nirum_type__

Conversation

@dahlia
Copy link
Member

@dahlia dahlia commented Nov 5, 2017

  • As I suggested from deserialize_meta won't union properly nirum-python#34 (comment), now generated Python classes have __nirum_type__ attribute which contains one of 'unboxed'/'enum'/'record'/'union'/'service'. The future versions of Python runtime library would be able to utilize this rather than diagnostics using isinstance()/hasattr() queries. See also examples on test_nirum_type().

  • Also as I suggested from the same comment above, now union classes have an immutable map named __nirum_tags__ that keys are tags and values are class objects. See also examples on test_nirum_tag_classes().

  • Since the bug Python enum doesn't allow “mro” for member name #185 was also applicable to union tag enums, also fixed it. See also test_union_reserved_keyword_for_tag() to reproduce the bug.

@dahlia dahlia added cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) cmp:runtime Component: Target runtimes target:python typ:bug Type: Bug/defect typ:enhance Type: Enhancement/new feature labels Nov 5, 2017
@dahlia dahlia self-assigned this Nov 5, 2017
@dahlia dahlia requested review from Kroisse and kanghyojun November 5, 2017 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) cmp:runtime Component: Target runtimes target:python typ:bug Type: Bug/defect typ:enhance Type: Enhancement/new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants