[Feature] Add support for generics
Đang mở
compiler
- Ngôn ngữ chính
- Rust
- Star
- 5.2k
- Fork
- 145
- Merge trung bình
- 5 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 7
Mô tả
**Is your feature request related to a problem? Please describe.**
We've been implementing array sort function that requires generics to better implement the function's return type. Currently it's impossible to create a type of another argument's type.
**Describe the solution you'd like**
Introduce the following syntax:
```js
fun foo(arr: [T]) {
// We declare `other` with the same type as `arr`
let other = [T]
$ cmd that modifies other $
return other
}
```
**Additional context**
#966
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.