cukr
1
Hi. Is there a way to check what would happen if I were to put a print(whatever) at the point I have my breakpoint at, without recompiling the app?
Lantua
2
1 Like
cukr
3
I didn't watch the whole hour long video, but it seems they are using po and expression commands to interact with the code. They are almost what I want, but unfortunately they don't behave like the real swift code, for example if your program is
func f<T>(_ foo: T) {
print(foo != nil)
}
let x: Int? = nil
f(x)
then expression print(foo != nil) will give you false, but the print in the code will give you true
Did I miss some trick from the video, or is there no way to replace having to recompile your code?
Lantua
4
Most definitely a bug, worthy of bug reports.
1 Like
cukr
5
I filed one a month ago but apparently debugger is working as expected
https://bugs.swift.org/browse/SR-12397
masters3d
(Chéyo Jiménez)
6
1 Like
cukr
8
Your workaround doesn't work for me, because it doesn't make me any more confident at using the debugger. I don't want to make two versions of EVERY generic function in ALL my programs. Also, the problem exists even if you don't use nil, even if you don't use Optional, even if you don't do any casting. I put an example in the bug report
Lantua
9
I agree with @cukr, it'd be very confusing if the debugger use the dynamic type, instead of the static one for any resolutions like this.