Re: [fpc-pascal] Scoped enums and inferred types

2018-02-20 Thread Michael Van Canneyt
On Wed, 21 Feb 2018, Ryan Joseph wrote: On Feb 21, 2018, at 1:54 PM, Michael Van Canneyt wrote: So this is "as designed". If you want to be able to write A, don't use scoped enums. I got the idea from Swift (one of the things it does right) and it’s really nice

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-20 Thread Ryan Joseph
> On Feb 21, 2018, at 2:01 PM, Sven Barth via fpc-pascal > wrote: > > The compiler does not know the type of the parameter, because overload > selection occurs only after all parameters have been parsed. So during > parsing the compiler would not know from

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-20 Thread Ryan Joseph
> On Feb 21, 2018, at 1:54 PM, Michael Van Canneyt > wrote: > > So this is "as designed". If you want to be able to write A, don't use > scoped enums. I got the idea from Swift (one of the things it does right) and it’s really nice to be able say "this = .value”

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-20 Thread Sven Barth via fpc-pascal
Am 21.02.2018 04:09 schrieb "Ryan Joseph" : Is this a missing feature or do you need to enable it or something? There is none. The compiler does not know the type of the parameter, because overload selection occurs only after all parameters have been parsed. So

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-20 Thread Michael Van Canneyt
On Wed, 21 Feb 2018, Ryan Joseph wrote: I just learned FPC has scoped enums, which is nice, but they lack what you could call “relative inference” based on the type being passed. In the example below the parameter “t” is TMyType but passing “A” doesn’t work. Doesn’t the compiler know the

[fpc-pascal] Scoped enums and inferred types

2018-02-20 Thread Ryan Joseph
I just learned FPC has scoped enums, which is nice, but they lack what you could call “relative inference” based on the type being passed. In the example below the parameter “t” is TMyType but passing “A” doesn’t work. Doesn’t the compiler know the type and can infer “A” is relative to the

Re: [fpc-pascal] Advanced note: local variable "i" is assigned but never used?

2018-02-20 Thread Vojtěch Čihák
It does not seem to do anything in latest FPC and Lazarus.   V. __ Od: Juha Manninen Komu: FPC-Pascal users discussions Datum: 20.02.2018 14:34 Předmět: Re: [fpc-pascal]

Re: [fpc-pascal] Advanced note: local variable "i" is assigned but never used?

2018-02-20 Thread Juha Manninen
Try with flag -OoDFA Juha ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Advanced note: local variable "i" is assigned but never used?

2018-02-20 Thread Vojtěch Čihák
Hello,   would it be possible to do more advanced checking of this note? This code   var i: Integer; begin   i:=5; end;           gives Note: Local variable "i" is assigned but never used   var i: Integer; begin   i:=5;   writeln('i ', i); end;           is OK   var i: Integer; begin   i:=5;  

Re: [fpc-pascal] glGetString crash

2018-02-20 Thread Ryan Joseph
> On Feb 20, 2018, at 2:07 PM, Jonas Maebe wrote: > > If you first create a context and it then still returns false, it may > also mean that you did not create the context properly. It’s up to SDL then I guess but it says I’m getting a 4.1 context (GL_VERSION), which is