bugGNUstep - Bugs: bug #53994, Can't set a value on keypath using...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #53994: Can't set a value on keypath using NSValue containing a size

Submitted by:  Ivan Vučica <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

Sun 27 May 2018 05:50:59 PM UTC, comment #1:

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

Ivan Vučica <ivucica>
Project Member
Sun 27 May 2018 05:49:56 PM UTC, original submission:

```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
```

Ivan Vučica <ivucica>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ivucica (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.3