Disallow old style generic constraint parsing
This commit is contained in:
@@ -1054,7 +1054,7 @@ proc funDecl(self: Parser, isOperator: bool = false): FunDecl =
|
||||
if self.match("*"):
|
||||
function.isPrivate = false
|
||||
self.checkDecl(function.isPrivate)
|
||||
if self.check(["<", "["]):
|
||||
if self.check("["):
|
||||
self.parseGenerics(function)
|
||||
if self.match(LeftParen):
|
||||
var parameter: tuple[name: IdentExpr, valueType: Expression]
|
||||
@@ -1215,7 +1215,7 @@ proc typeDecl(self: Parser): TypeDecl =
|
||||
result = newTypeDecl(name, newOrderedTable[string, TypeField](), true, token, @[], false, false)
|
||||
result.file = self.file
|
||||
result.isPrivate = not self.match("*")
|
||||
if self.check(["<", "["]):
|
||||
if self.check("["):
|
||||
self.parseGenerics(result)
|
||||
self.checkDecl(result.isPrivate)
|
||||
self.expect("=", "expecting '=' after type name")
|
||||
|
||||
Reference in New Issue
Block a user