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:
|
case condition.kind:
|
||||||
of identExpr:
|
of identExpr:
|
||||||
list.add((accept, self.inferOrError(condition)))
|
list.add((accept, self.inferOrError(condition)))
|
||||||
|
if list[^1].kind.kind == Auto:
|
||||||
|
self.error("automatic types cannot be used within generics", condition)
|
||||||
of binaryExpr:
|
of binaryExpr:
|
||||||
let condition = BinaryExpr(condition)
|
let condition = BinaryExpr(condition)
|
||||||
case condition.operator.lexeme:
|
case condition.operator.lexeme:
|
||||||
|
|
Loading…
Reference in New Issue