-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to specify custom type parameter validation
- Loading branch information
1 parent
ecd3f23
commit 7b65121
Showing
5 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2906,6 +2906,7 @@ type FunctionType struct { | |
ReturnTypeAnnotation TypeAnnotation | ||
Arity *Arity | ||
ArgumentExpressionsCheck ArgumentExpressionsCheck | ||
TypePrametersCheck TypeParametersCheck | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
darkdrag00nv2
Author
Contributor
|
||
Members *StringMemberOrderedMap | ||
TypeParameters []*TypeParameter | ||
Parameters []Parameter | ||
|
@@ -3376,6 +3377,12 @@ type ArgumentExpressionsCheck func( | |
invocationRange ast.Range, | ||
) | ||
|
||
type TypeParametersCheck func( | ||
typeArguments *TypeParameterTypeOrderedMap, | ||
report func(err error), | ||
invocationRange ast.Range, | ||
) | ||
|
||
// BaseTypeActivation is the base activation that contains | ||
// the types available in programs | ||
var BaseTypeActivation = NewVariableActivation(nil) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Great idea, nice! Small nit: Just like the
ArgumentExpressionsCheck
checks arguments passed to parameters, this check checks the type arguments passed to the type parameters. Maybe rename this field and the type with the same name toTypeArumentsCheck