File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 152
152
153
153
``` txt
154
154
error: Syntax error
155
- ┌─ /src/parse/error.gleam:1:6
155
+ ┌─ /src/parse/error.gleam:2:12
156
156
│
157
- 1 │ fn id<T>(x: T) { x }
158
- │ ^ I was expecting `(` here.
157
+ 2 │ type Either<a, b> {
158
+ │ ^ I was expecting `(` here.
159
159
160
- If you were trying to define a generic function, Gleam does not use angle brackets.
161
- Instead, you should write types in the parameter list with lower-case names.
162
- Each unique lower-case name becomes a type variable:
160
+ Type parameters use lowercase names and are surrounded by parentheses.
163
161
164
- fn example(arg: t) -> t
162
+ type Either(a, b) {
165
163
166
- See: https://tour.gleam.run/functions /generic-functions /
164
+ See: https://tour.gleam.run/data-types /generic-custom-types /
167
165
```
168
166
169
167
([ Aaron Christiansen] ( https://github.com/AaronC81 ) )
Original file line number Diff line number Diff line change @@ -2584,7 +2584,7 @@ where
2584
2584
Err ( ParseError {
2585
2585
error : ParseErrorType :: TypeDefinitionAngleGenerics {
2586
2586
name : upname,
2587
- arguments : arguments ,
2587
+ arguments,
2588
2588
} ,
2589
2589
location : SrcSpan {
2590
2590
start : less_start,
You can’t perform that action at this time.
0 commit comments