Added error handling for using auto in a generic constraint
This commit is contained in:
parent
572443a988
commit
6caaf7e707
|
@ -1431,6 +1431,8 @@ proc unpackGenerics(self: Compiler, condition: Expression, list: var seq[tuple[m
|
|||
case condition.kind:
|
||||
of identExpr:
|
||||
list.add((accept, self.inferOrError(condition)))
|
||||
if list[^1].kind.kind == Auto:
|
||||
self.error("automatic types cannot be used within generics", condition)
|
||||
of binaryExpr:
|
||||
let condition = BinaryExpr(condition)
|
||||
case condition.operator.lexeme:
|
||||
|
|
Loading…
Reference in New Issue