Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 01:26
    joshuaavalon closed #33482
  • 00:44
    ahejlsberg synchronize #32695
  • 00:44

    ahejlsberg on assertionsInControlFlow

    Fix forEachChild (compare)

  • 00:23
    ahejlsberg synchronize #32695
  • 00:18
    ahejlsberg synchronize #32695
  • 00:18

    ahejlsberg on assertionsInControlFlow

    Add tests Accept new baselines (compare)

  • 00:12
    IllusionMH opened #33538
  • 00:00
    typescript-bot closed #15005
  • 00:00
    typescript-bot closed #17232
  • Sep 20 23:57
    andrewbranch opened #33537
  • Sep 20 22:19
    sandersn edited #33509
  • Sep 20 21:58
    RyanCavanaugh closed #10882
  • Sep 20 21:58
    RyanCavanaugh labeled #10882
  • Sep 20 21:58
    RyanCavanaugh unlabeled #10882
  • Sep 20 21:58
    RyanCavanaugh labeled #10882
  • Sep 20 21:58
    RyanCavanaugh closed #10944
  • Sep 20 21:58
    RyanCavanaugh unlabeled #10944
  • Sep 20 21:56
    RyanCavanaugh closed #11249
  • Sep 20 21:56
    RyanCavanaugh unlabeled #11249
  • Sep 20 21:55
    RyanCavanaugh closed #10666
AnyhowStep
@AnyhowStep
interface MyPropertiesBase { x : number }
abstract class Foo
{
    properties!: MyPropertiesBase
    abstract CastProperties: MyPropertiesBase   
}

class FooImplementation extends Foo 
{
    constructor (properties : MyPropertiesBase) {
        super();
        this.properties = properties;
    }
    get CastProperties(){
        return this.properties 
    }
}

const myFoo = new FooImplementation({x:9001});
console.log(myFoo.properties.x); //9001
Look. Just a getter.
It works
No run-time errors
Because I'm not trying to set a value
"i am retrieving", as you put it
Somewhere, you're trying to use your getter-only property as a setter.
But there is no spoon. And there is no setter.
Triggs9
@Triggs9
i am looking, but i just created the property, i have no clue where id be setting something i just created.
AnyhowStep
@AnyhowStep
Mark your abstract property as readonly and check for compile errors
Triggs9
@Triggs9
the code i am working with is alot more complex than i think you maybe thinking... i might upload my repo to github and see if you can take a look
https://github.com/Triggs9/OriWebFramework
requires dotnet core, but if thats installed if you navigate to the DotnetCore folder and do dotnet run it should go
the main file i am working with is: DotNetCore/react_app/src/OriWebFrameworkV2/Core/Classes.tsx
Triggs9
@Triggs9
commenting out line 2224 and 2226 allows it to compile and everything works as expected again though i want them to be abstract to force the implementing user to cast them correctly
AnyhowStep
@AnyhowStep
Why not add a setter, then have the setter throw an error, then inspect the call stack
Then fix the offending line of code
Triggs9
@Triggs9
so just did that
and the call stack points to BuildingBlock_SVG constructor the class that houses the abstract CastProperties
the very start of it
its something behind the scene that i have no control over
Bruce Pascoe
@fatcerberus
@AnyhowStep nobody can ever get the modulo/remainder distinction right. Isn’t the only difference for negative numbers?
Everyone’s mod is actually remainder iirc. JS, C/C++, etc
AnyhowStep
@AnyhowStep
Yeah, the only difference is for negative numbers
remainder takes the sign of the LHS.
modulo takes the sign of the RHS.
I really want to fork sql.js and maintain it myself -__-
I've found so many bugs with it
Keith Layne
@keithlayne
settle down
AnyhowStep
@AnyhowStep
I've basically already copy-pasted the js from node_modules into my src and I'm editing it by hand =(
I might as well just do it =x
And they don't have bigint support, either.
So, while SQLite can handle 64-bit (signed) integers fine, the JS is just converting everything into a double
AnyhowStep
@AnyhowStep
The source code literally says if (!result) then return null
And !0 is true. So, it thinks the number zero is null.
Causing functions that return zero
To return null
Keith Layne
@keithlayne
wish TS were smarter about that and didn't narrow i.e. number | null in that case.
also NaN
just another case of your favorite: logical operators applied to non-booleans
AnyhowStep
@AnyhowStep
;( people never learn
I wanted an angry face, not a quote dammit >;(
Keith Layne
@keithlayne
why are you winking at me you strange angry man
Orta
@orta
We now have PR based playgrounds for anything which the TS team request a pack on
AnyhowStep
@AnyhowStep
<3
AnyhowStep
@AnyhowStep
I did it. I forked the damn thing. Maybe I'll look into converting it to TS or something. I can't read coffee =/
AnyhowStep
@AnyhowStep
Couldn't even get past the build step >;(
AnyhowStep
@AnyhowStep
Sweet. Got it to work. By... Just spamming build until it succeeded... -___-
Bruce Pascoe
@fatcerberus
They say that’s the definition of insanity, doing the same thing over and over expecting a different result. In our world it’s just... you know, regular stuff
AnyhowStep
@AnyhowStep
I just added BigInt support to my fork, woot
No more truncating my damn 64-bit signed integers >;(
AnyhowStep
@AnyhowStep
This means even boolean values will be interpreted as bigint, though... Meh