You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
whentrue:
procmain()=let a1 = [NaN, Inf]
let a2 =float32(Inf)
let a3 = [float32(NaN), float32(NaN)]
# let a2 = [float32(NaN), float32(Inf)]# let b = (1.0'f32 / 0.0'f32, )let val =float32(Inf)
let b = [val, val]
const val2 =float32(Inf)
let b2 = [val2, val2] # BUG with nim cpp# c: ok# cpp: bug:# error: non-constant-expression cannot be narrowed from type 'double' to 'NF32' (aka 'float') in initializer list [-Wc++11-narrowing]# let b3 = [float32(Inf), float32(Inf)] # ditto# let b4 = [float32(1.0'f32 / 0.0'f32)] # ditto# let b5 = (float32(1.0'f32 / 0.0'f32),) # dittomain()
Current Output
/@mt12274.nim.cpp:52:86: error: non-constant-expression cannot be narrowed from type 'double' to 'NF32' (aka 'float') in initializer list [-Wc++11-narrowing]
static NIM_CONST tyArray__4YxcnnI8do9a6vmNKtzdSKw TM__WkvCQIn9ahz9cNeh9cQ2UK5gA_4 = {INF,
^~~
/Users/timothee/git_clone/nim/Nim_devel/lib/nimbase.h:506:17: note: expanded from macro 'INF'
# define INF (1.0 / 0.0)
^~~~~~~~~~~
/Users/timothee/git_clone/nim/timn/build/nimcache/@mt12274.nim.cpp:52:86: note: insert an explicit cast to silence this issue
static NIM_CONST tyArray__4YxcnnI8do9a6vmNKtzdSKw TM__WkvCQIn9ahz9cNeh9cQ2UK5gA_4 = {INF,
^~~
static_cast<NF32>( )
/Users/timothee/git_clone/nim/Nim_devel/lib/nimbase.h:506:17: note: expanded from macro 'INF'
# define INF (1.0 / 0.0)
^~~~~~~~~~~
/Users/timothee/git_clone/nim/timn/build/nimcache/@mt12274.nim.cpp:53:1: error: non-constant-expression cannot be narrowed from type 'double' to 'NF32' (aka 'float') in initializer list [-Wc++11-narrowing]
INF}
^~~
/Users/timothee/git_clone/nim/Nim_devel/lib/nimbase.h:506:17: note: expanded from macro 'INF'
# define INF (1.0 / 0.0)
^~~~~~~~~~~
/Users/timothee/git_clone/nim/timn/build/nimcache/@mt12274.nim.cpp:53:1: note: insert an explicit cast to silence this issue
INF}
^~~
static_cast<NF32>( )
/Users/timothee/git_clone/nim/Nim_devel/lib/nimbase.h:506:17: note: expanded from macro 'INF'
# define INF (1.0 / 0.0)
Example
Current Output
Expected Output
works
Additional Information
1.5.1 97970d9
The text was updated successfully, but these errors were encountered: