Skip to content

Feature proposal: Reflection #104

@Zffu

Description

@Zffu

Proposal Id: reflection

This proposal introduces reflection to Quickfall. Reflection will be used at compile time to obtain information about types.

Furthermore, the proposal introduces the following compile time operations:

  • types<bound or trait>: Gets every type with the bound or trait
  • types<>: Gets every type registered in the current global scope
  • traits<type>: Gets the traits of the given type
  • bounds<type>: Gets the bounds of the given type
  • methods<type>: Gets every method of the given type if applicable, else error
  • fields<type>: Gets every field of the given type if applicable else error.
  • reflectfor: A new kind of for loop made to iterate trough reflection data
  • name<object>: Makes a static string of the reflection object's name

Every single macro will run at compile time and no actual type info will be usable at runtime besides the object names. This is to guarantee a clean Reflection and healthy performance whilst using it.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions