mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
```nim
type
Case = object
case x: float
of 1.0:
id: int
else:
ta: float
```
It segfaults with `fatal error: invalid kind for firstOrd(tyFloat)`
It was caused by https://github.com/nim-lang/Nim/pull/12591 and has
affected discriminators of float types since 1.2.x
I think no one is using discriminators of float types anyway so I simply
disable it like what was done to discriminators of string types (ref
https://github.com/nim-lang/Nim/pull/15080)
ref https://github.com/nim-lang/nimony/pull/1069
(cherry picked from commit d2fee7dbab)
13 lines
186 B
Nim
13 lines
186 B
Nim
discard """
|
|
errormsg: "selector must be of an ordinal type"
|
|
"""
|
|
|
|
type
|
|
Case = object
|
|
case x: float
|
|
of 1.0:
|
|
id: int
|
|
else:
|
|
ta: float
|
|
|
|
var s = Case(x: 4.0, id: 1) |