Closed timotheecour closed 6 years ago
It was @Araq's last couple of commits that broke the CI and were directly pushed to devel
I'm suspecting #9318 since it last touched tests/assign/tassign.nim but how come the CI was green for that PR?
After that file was modified, the tests were run for six times in that PR: all six times there were no problems with that file.
EDIT: Building the latest Nim devel and running tests/assign/tassign.nim now produces this unexpected result.
This part:
import typetraits
block toverload_asgn:
type
Concrete = object
a, b: string
proc `=`(d: var Concrete; src: Concrete) =
shallowCopy(d.a, src.a)
shallowCopy(d.b, src.b)
echo "Concrete '='"
var x, y: array[0..2, Concrete]
var cA, cB: Concrete
var cATup, cBTup: tuple[x: int, ha: Concrete]
x = y
cA = cB
cATup = cBTup
type
GenericT[T] = object
a, b: T
proc `=`[T](d: var GenericT[T]; src: GenericT[T]) =
shallowCopy(d.a, src.a)
shallowCopy(d.b, src.b)
echo "GenericT[T] '=' ", type(T).name
var ag: GenericT[int]
var bg: GenericT[int]
ag = bg
var xg, yg: array[0..2, GenericT[float]]
var cAg, cBg: GenericT[string]
var cATupg, cBTupg: tuple[x: int, ha: GenericT[int8]]
xg = yg
cAg = cBg
cATupg = cBTupg
var caSeqg, cbSeqg: seq[GenericT[bool]]
newSeq(cbSeqg, 4)
caSeqg = cbSeqg
when false:
type
Foo = object
case b: bool
of false: xx: GenericT[int]
of true: yy: bool
var
a, b: Foo
a = b
used to produce:
Concrete '='
Concrete '='
Concrete '='
Concrete '='
Concrete '='
GenericT[T] '=' int
GenericT[T] '=' float
GenericT[T] '=' float
GenericT[T] '=' float
GenericT[T] '=' string
GenericT[T] '=' int8
GenericT[T] '=' bool
GenericT[T] '=' bool
GenericT[T] '=' bool
GenericT[T] '=' bool
but now there's no output.
but now there's no output.
Sorry, my move optimizations now optimize away all the assignments...
ref: https://github.com/nim-lang/Nim/commit/1475697fbf0b7604d805e5c11467695c0c82512c but unclear to me whether it's a proper fix or temporary workaround (in which case should we re-open?)
I'm disabling this section of the test... it's hard to fix, the compiler is way too smart/aggressive (gitter)
eg: https://travis-ci.org/nim-lang/Nim/jobs/440787636 for a PR https://github.com/nim-lang/Nim/pull/9336 that only touches doc/manual.rst
even if we fix this, how could it have passed through CI's testing ?
EDIT I'm suspecting https://github.com/nim-lang/Nim/pull/9318 since it last touched tests/assign/tassign.nim but how come the CI was green for that PR? we shouldn't close this issue until we figure out root cause /cc @narimiran @araq