forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nim-lang#4701 from mbaulch/fix4675
pickBestCandidate: pre-calculate candidates when symbol table modified
- Loading branch information
Showing
4 changed files
with
99 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
type | ||
Field* = object | ||
elemSize*: int | ||
|
||
template `+`*(x: untyped, y: Field): untyped = x |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
type | ||
Foo*[T] = object | ||
v*: T | ||
|
||
template `+`*(x: Foo, y: Foo): untyped = x | ||
|
||
template newvar*(r: untyped): untyped {.dirty.} = | ||
var r: float | ||
|
||
template t1*(x: Foo): untyped = | ||
newvar(y1) | ||
x | ||
template t2*(x: Foo): untyped = | ||
newvar(y2) | ||
x |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# issue 4675 | ||
import importA # comment this out to make it work | ||
import importB | ||
|
||
var x: Foo[float] | ||
var y: Foo[float] | ||
let r = t1(x) + t2(y) |