Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-05 Thread Ondrej Pokorny
On 05.11.2015 15:46, Mattias Gaertner wrote: For example a sorted TStringList with the 'Objects' as the position. The list is seldom edited so editing does not need much speed. Fast search is important. As long as there are only 20 types the structure is irrelevant. But when we extend the list

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-05 Thread Mattias Gaertner
On Wed, 4 Nov 2015 08:23:26 +0100 Ondrej Pokorny wrote: > Fixed in r50217. > > On 04.11.2015 02:14, Mattias Gaertner wrote: > >> A problem could be with such code: > >> > > >> >var > >> >i: SizeInt; > >> >j: Integer; > >> >begin > >> >k:=i+j; > >> >end; > >> > >

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-05 Thread Mattias Gaertner
On Wed, 4 Nov 2015 05:42:57 +0100 Ondrej Pokorny wrote: >[...] > > Many libs has such types. I have not counted, but I guess the FPC > > sources has hundreds of them. Probably some of them conflict each other. > > So something better than a TStringList should be used. > >

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-05 Thread Mattias Gaertner
On Thu, 5 Nov 2015 07:36:53 +0100 Ondrej Pokorny wrote: > On 03.11.2015 20:26, Mattias Gaertner wrote: > > Of course there are some hard coded defaults in codetools. For example > > "i:=3" can be any integer type. > > It would be nice if integer constants were able to resolve

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-04 Thread Ondrej Pokorny
On 03.11.2015 20:26, Mattias Gaertner wrote: Of course there are some hard coded defaults in codetools. For example "i:=3" can be any integer type. It would be nice if integer constants were able to resolve their type: 3 -> ShortInt 180 -> SmallInt etc etc. This would be good for: var b:

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-03 Thread Mattias Gaertner
On Tue, 3 Nov 2015 19:37:04 +0100 Ondrej Pokorny wrote: > On 03.11.2015 17:34, Mattias Gaertner wrote: > > codetools use only a simple heuristic to calculate the type of a > > binary operator. > > The function TFindDeclarationTool.CalculateBinaryOperator needs to be > >

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-03 Thread Ondrej Pokorny
On 03.11.2015 20:26, Mattias Gaertner wrote: procedure Test; >var >I: Integer; >S: SmallInt; >begin >Res := I + S; >end; > >Something like: >1.) >I = (Integer -> longint) >S = SmallInt >2.) >ResultBasicType = Compare(longint, SmallInt) -> longint -> I >3.) >ResultType =

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-03 Thread Michael Ring
Thank you for the fix, just tried it on fresh trunk, works! Michael Am 03.11.15 um 17:34 schrieb Mattias Gaertner: On Tue, 3 Nov 2015 17:24:02 +0100 Ondrej Pokorny wrote: On 03.11.2015 17:08, Mattias Gaertner wrote: Fixed. How did you find it from the description? I

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-03 Thread Ondrej Pokorny
On 03.11.2015 17:34, Mattias Gaertner wrote: codetools use only a simple heuristic to calculate the type of a binary operator. The function TFindDeclarationTool.CalculateBinaryOperator needs to be extended for Alias types (e.g. 'integer' instead of longint) and for ranges (e.g. if the operands

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-03 Thread Ondrej Pokorny
Probably the best approach is: 1.) Compare base types with the table. 1a.) If they are equal, goto 2. 1b.) If they differ, set winner according to table and go to 3. 2.) Compare aliases with the table, set winner. 3.) Use the original alias of the winner as result. About the table: We need

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-03 Thread Ondrej Pokorny
On 03.11.2015 20:34, Ondrej Pokorny wrote: A problem could be with such code: var i: SizeInt; j: Integer; begin k:=i+j; end; Because obviously on 32bit SizeInt=longint and Integer=longint, so there won't be a deterministic way which type wins. But this is a similar issue like the one

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-03 Thread Mattias Gaertner
On Tue, 3 Nov 2015 20:34:30 +0100 Ondrej Pokorny wrote: > On 03.11.2015 20:26, Mattias Gaertner wrote: > >> procedure Test; > >> >var > >> >I: Integer; > >> >S: SmallInt; > >> >begin > >> >Res := I + S; > >> >end; > >> > > >> >Something like: > >> >1.) > >> >I =

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-03 Thread Mattias Gaertner
On Tue, 3 Nov 2015 21:06:45 +0100 Ondrej Pokorny wrote: > Probably the best approach is: > > 1.) Compare base types with the table. > 1a.) If they are equal, goto 2. > 1b.) If they differ, set winner according to table and go to 3. > > 2.) Compare aliases with the table, set

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-03 Thread Ondrej Pokorny
On 04.11.2015 02:25, Mattias Gaertner wrote: About the table: >We need one table for integer and one for floating-point types. >The integer table could look like ['int64', 'sizeint', 'integer', >'smallint'] (but with all integer types and probably a good idea to >allow the user to modify and

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-03 Thread Ondrej Pokorny
Fixed in r50217. On 04.11.2015 02:14, Mattias Gaertner wrote: A problem could be with such code: > >var >i: SizeInt; >j: Integer; >begin >k:=i+j; >end; > >Because obviously on 32bit SizeInt=longint and Integer=longint, so there >won't be a deterministic way which type wins. Left

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-03 Thread Mattias Gaertner
On Tue, 3 Nov 2015 11:15:02 +0100 Michael Ring wrote: > Here's the info: > > /usr/local/bin/fpc -i > Free Pascal Compiler version 2.6.4 > > Compiler Date : 2014/02/26 > Compiler CPU Target: i386 > > --- > >LCL_PLATFORM=carbon >CPU_TARGET=i386 >

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-03 Thread Ondrej Pokorny
On 03.11.2015 17:08, Mattias Gaertner wrote: Fixed. How did you find it from the description? You are a wizard :) Sorry for introducing the bug in my code. But I know how it happened: it was introduced by CodeTools variable completion: procedure TIDECommands.PostponeUpdateEvents; begin

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-03 Thread Mattias Gaertner
On Tue, 3 Nov 2015 17:24:02 +0100 Ondrej Pokorny wrote: > On 03.11.2015 17:08, Mattias Gaertner wrote: > > Fixed. > > How did you find it from the description? I didn't. I tested on OS X. > You are a wizard :) > Sorry for introducing the bug in my code. But I know how it

Re: [Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-11-02 Thread Mattias Gaertner
On Thu, 29 Oct 2015 00:55:46 +0100 Michael Ring wrote: > I today realized that current trunk does not work anymore after Rev > 50151, Lazarus starts and when I load a project I get a Range Check > Error and after this I cannot open source files. > > Is this a known

[Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

2015-10-28 Thread Michael Ring
I today realized that current trunk does not work anymore after Rev 50151, Lazarus starts and when I load a project I get a Range Check Error and after this I cannot open source files. Is this a known issue? Michael -- ___ Lazarus mailing list