Discussion:
[bug #53994] Can't set a value on keypath using NSValue containing a size
Ivan Vučica
2018-05-27 17:49:58 UTC
Permalink
URL:
<http://savannah.gnu.org/bugs/?53994>

Summary: Can't set a value on keypath using NSValue
containing a size
Project: GNUstep
Submitted by: ivucica
Submitted on: Sun 27 May 2018 05:49:56 PM UTC
Category: Base/Foundation
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any

_______________________________________________________

Details:

```objective-c
#import <Foundation/Foundation.h>

@interface A : NSObject
{
NSSize _s;
}
@end
@implementation A
- (NSSize) s {
return self->_s;
}
- (void) setS: (NSSize) s {
self->_s = s;
}
@end
int main() {
NSSize in = NSMakeSize(1.0, 2.0);
NSValue * v = [NSValue valueWithSize: in];
/*
originally observed with:
NSValue * v = [NSValue valueWithBytes: &in
objCType: @encode(NSSize)];
*/
A * a = [A new];
[a setValue: v
forKey: @"s"];

return 0;
}
```

Output:

```
$ clang `gnustep-config --objc-flags` `gnustep-config --objc-libs`
`gnustep-config --base-libs` repro.m -o repro && ./repro
clang: warning: argument unused during compilation: '-fobjc-nonfragile-abi'
clang: warning: argument unused during compilation: '-fobjc-nonfragile-abi'
2018-05-27 18:45:53.501 repro[14679:14679] match! point is {_NSPoint=dd}, type
is {_NSSize=dd}
./repro: Uncaught exception NSInvalidArgumentException, reason:
[GSSizeValue-pointValue] should be overridden by subclass
Aborted
```




_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?53994>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
Ivan Vučica
2018-05-27 17:50:59 UTC
Permalink
Follow-up Comment #1, bug #53994 (project gnustep):

Also filed as https://github.com/gnustep/libs-base/issues/25

_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?53994>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
Fred Kiefer
2018-06-28 21:14:16 UTC
Permalink
Update of bug #53994 (project gnustep):

Status: None => Works For Me
Assigned to: None => FredKiefer
Open/Closed: Open => Declined

_______________________________________________________

Follow-up Comment #2:

I think this bug was already fixed when you filed the bug report. Still it
would be great to have the test code from your github branch in base.

_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?53994>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Loading...