diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-02-27 01:43:13 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-27 10:43:13 +0100 |
commit | 6a0e87eb387c13f1d6f78e1736c23cdb4a06b504 (patch) | |
tree | 34361881f4062eabb459596128979b56eafc8add /tests | |
parent | 42dad3a836f7eed860f300e68b33d4c0b39bd1f4 (diff) | |
download | Nim-6a0e87eb387c13f1d6f78e1736c23cdb4a06b504.tar.gz |
cleanup Ordinal (#13501)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/system/tsystem_misc.nim | 17 | ||||
-rw-r--r-- | tests/varres/tprevent_forloopvar_mutations.nim | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/tests/system/tsystem_misc.nim b/tests/system/tsystem_misc.nim index 56af97f36..fff8b7022 100644 --- a/tests/system/tsystem_misc.nim +++ b/tests/system/tsystem_misc.nim @@ -193,3 +193,20 @@ block: a = {k1} b = {k1,k2} doAssert a < b + + +block: # Ordinal + doAssert int is Ordinal + doAssert uint is Ordinal + doAssert int64 is Ordinal + doAssert uint64 is Ordinal + doAssert char is Ordinal + type Foo = enum k1, k2 + doAssert Foo is Ordinal + doAssert Foo is SomeOrdinal + doAssert enum is SomeOrdinal + + # these fail: + # doAssert enum is Ordinal # fails + # doAssert Ordinal is SomeOrdinal + # doAssert SomeOrdinal is Ordinal diff --git a/tests/varres/tprevent_forloopvar_mutations.nim b/tests/varres/tprevent_forloopvar_mutations.nim index 398191658..ac62608af 100644 --- a/tests/varres/tprevent_forloopvar_mutations.nim +++ b/tests/varres/tprevent_forloopvar_mutations.nim @@ -3,9 +3,9 @@ discard """ line: 17 nimout: '''type mismatch: got <int> but expected one of: -proc inc[T: Ordinal | uint | uint64](x: var T; y = 1) +proc inc[T: Ordinal](x: var T; y = 1) first type mismatch at position: 1 - required type for x: var T: Ordinal or uint or uint64 + required type for x: var T: Ordinal but expression 'i' is immutable, not 'var' expression: inc i |