-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
properly disallow unresolved generic proc values (#22005)
* properly disallow unresolved generic proc values * mirrors semoperand * shallow efTypeAllowed, add back special case
- Loading branch information
Showing
3 changed files
with
15 additions
and
10 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
10 changes: 2 additions & 8 deletions
10
tests/misc/tnoinst.nim → tests/errmsgs/tunresolvedinnerproc.nim
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 |
---|---|---|
@@ -1,16 +1,10 @@ | ||
discard """ | ||
errormsg: "instantiate 'notConcrete' explicitly" | ||
line: 12 | ||
disabled: "true" | ||
""" | ||
|
||
proc wrap[T]() = | ||
proc notConcrete[T](x, y: int): int = | ||
var dummy: T | ||
result = x - y | ||
|
||
var x: proc (x, y: T): int | ||
x = notConcrete | ||
|
||
x = notConcrete #[tt.Error | ||
^ 'notConcrete' doesn't have a concrete type, due to unspecified generic parameters.]# | ||
|
||
wrap[int]() |