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.
test case haul for old generic/template/macro issues
closes nim-lang#12582, closes nim-lang#19552, closes nim-lang#2465, closes nim-lang#4596, closes nim-lang#15246, closes nim-lang#12683, closes nim-lang#7889, closes nim-lang#4547, closes nim-lang#12415, closes nim-lang#2002, closes nim-lang#1771, closes nim-lang#5121 The test for nim-lang#5648 is also moved into its own test from `types/tissues_types` due to not being joinable.
- Loading branch information
Showing
9 changed files
with
248 additions
and
34 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
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
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,12 +1,21 @@ | ||
var x = 0 | ||
block: # issue #16005 | ||
var x = 0 | ||
|
||
block: | ||
type Foo = object | ||
x: float # ok | ||
|
||
template main() = | ||
block: | ||
type Foo = object | ||
x: float # Error: cannot use symbol of kind 'var' as a 'field' | ||
x: float # ok | ||
|
||
template main() = | ||
block: | ||
type Foo = object | ||
x: float # Error: cannot use symbol of kind 'var' as a 'field' | ||
|
||
main() | ||
|
||
block: # issue #19552 | ||
template test = | ||
type | ||
test2 = ref object | ||
reset: int | ||
|
||
main() | ||
test() |
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,32 @@ | ||
discard """ | ||
output: ''' | ||
ptr Foo | ||
''' | ||
joinable: false | ||
""" | ||
# not joinable because it causes out of memory with --gc:boehm | ||
|
||
# issue #5648 | ||
|
||
import typetraits | ||
|
||
type Foo = object | ||
bar: int | ||
|
||
proc main() = | ||
var f = create(Foo) | ||
f.bar = 3 | ||
echo f.type.name | ||
|
||
discard realloc(f, 0) | ||
|
||
var g = Foo() | ||
g.bar = 3 | ||
|
||
var | ||
mainPtr = cast[pointer](main) | ||
mainFromPtr = cast[typeof(main)](mainPtr) | ||
|
||
doAssert main == mainFromPtr | ||
|
||
main() |
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