added kernel only class

This commit is contained in:
pca006132 2021-04-11 23:36:18 +08:00
parent d82edd2753
commit 30dd6a1ac1

View File

@ -88,6 +88,14 @@ Only types supported in the kernel can be referenced.
does not fit into int32, it would raise an error. (Issue #2)
* Only `uint32`, `int32` (and range of them) can be used as index.
### Kernel Only class
* Annotate the class with `@kernel`.
* Functions are all kernel only, including constructor.
Questions:
* Should we also do `@portable`?
* Support inheritance and polymorphism?
## Generics
We use [type variable](https://docs.python.org/3/library/typing.html#typing.TypeVar) for denoting generics.