mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-10 10:49:22 +02:00

as described on http://releases.llvm.org/8.0.0/tools/clang/docs/LanguageExtensions.html#objective-c-features (rest of mantis #35994) git-svn-id: trunk@42816 -
32 lines
976 B
ObjectPascal
32 lines
976 B
ObjectPascal
|
|
{$MODE OBJFPC}
|
|
{$MODESWITCH OBJECTIVEC1}
|
|
|
|
program test;
|
|
|
|
uses
|
|
CocoaAll;
|
|
|
|
var
|
|
obj: NSObject;
|
|
path: NSString;
|
|
dict: NSDictionary;
|
|
mDict: NSMutableDictionary;
|
|
pool: NSAutoReleasePool;
|
|
begin
|
|
pool := NSAutoReleasePool.alloc.init;
|
|
obj := NSObject.alloc.init;
|
|
|
|
path := NSSTR('');
|
|
dict := NSDictionary.dictionaryWithContentsOfFile(path);
|
|
dict := NSDictionary.alloc.initWithContentsOfFile(path); // ERROR: got "NSArray" expected "NSDictionary"
|
|
dict := NSDictionary(NSDictionary.alloc).initWithContentsOfFile(path);
|
|
|
|
dict := NSMutableDictionary.dictionaryWithContentsOfFile(path);
|
|
mDict := NSMutableDictionary.dictionaryWithContentsOfFile(path); // ERROR: got "NSDictionary" expected "NSMutableDictionary"
|
|
dict := NSMutableDictionary.alloc.initWithContentsOfFile(path); // ERROR: got "NSArray" expected "NSDictionary"
|
|
mDict := NSMutableDictionary.alloc.initWithContentsOfFile(path); // ERROR: got "NSArray" expected "NSDictionary"
|
|
|
|
pool.release;
|
|
end.
|