diff options
-rw-r--r-- | compiler/types.nim | 2 | ||||
-rw-r--r-- | tests/ccgbugs/tnil_type.nim | 3 |
2 files changed, 1 insertions, 4 deletions
diff --git a/compiler/types.nim b/compiler/types.nim index 29d880ff6..e2de8280e 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -1310,7 +1310,7 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind, tyNone, tyForward, tyFromExpr: result = t of tyNil: - if kind != skConst and kind != skParam and kind != skResult: result = t + if kind != skConst and kind != skParam: result = t of tyString, tyBool, tyChar, tyEnum, tyInt..tyUInt64, tyCString, tyPointer: result = nil of tyOrdinal: diff --git a/tests/ccgbugs/tnil_type.nim b/tests/ccgbugs/tnil_type.nim index 12310dae9..9921b24a3 100644 --- a/tests/ccgbugs/tnil_type.nim +++ b/tests/ccgbugs/tnil_type.nim @@ -13,6 +13,3 @@ f3(typeof(nil)) proc f4[T](_: T) = discard f4(nil) - -proc f5(): typeof(nil) = nil -discard f5() |