microsoft / pxt

Microsoft MakeCode (PXT - Programming eXperience Toolkit)
https://makecode.com
MIT License
2.1k stars 588 forks source link

Cannot extend native interfaces #6859

Open darzu opened 4 years ago

darzu commented 4 years ago

This interface:

    export interface MinimapImage extends Image {
        minimapScale: MinimapScale;
    }

produces this runtime error: image

in this program: https://makecode.com/_gxCUs9bgWV5R

Using this extension: https://github.com/darzu/arcade-minimap

pelikhan commented 4 years ago

Image is a “native” type, implemented in C++ and JS sim. I am not sure it is a good idea to try to extend it.


From: Daryl Zuniga notifications@github.com Sent: Wednesday, April 15, 2020 4:56:36 PM To: microsoft/pxt pxt@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [microsoft/pxt] Cannot extend native interfaces (#6859)

This interface:

export interface MinimapImage extends Image {
    minimapScale: MinimapScale;
}

produces this runtime error: [image]https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F6453828%2F79400071-f942f600-7f39-11ea-861a-7e1b92ea6d07.png&data=02%7C01%7Cjhalleux%40microsoft.com%7C758c6cee63274271b3a608d7e198a22f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637225917979672297&sdata=wdFTGknJD918i%2FvGUxTEKHKj9EId%2F5To7svR3u0lQuE%3D&reserved=0

in this program: https://makecode.com/_gxCUs9bgWV5Rhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmakecode.com%2F_gxCUs9bgWV5R&data=02%7C01%7Cjhalleux%40microsoft.com%7C758c6cee63274271b3a608d7e198a22f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637225917979682290&sdata=y47nlf8eyKtSmlqPY5d0WXZxJiyICka2nL%2F2Avl1kOA%3D&reserved=0

Using this extension: https://github.com/darzu/arcade-minimaphttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdarzu%2Farcade-minimap&data=02%7C01%7Cjhalleux%40microsoft.com%7C758c6cee63274271b3a608d7e198a22f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637225917979692287&sdata=oCOkslx1ko0DJivmN0gfhOSeN0qlPokPe9r5MrY%2Boe8%3D&reserved=0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fpxt%2Fissues%2F6859&data=02%7C01%7Cjhalleux%40microsoft.com%7C758c6cee63274271b3a608d7e198a22f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637225917979692287&sdata=rsvoTckjENvSTozVrsbznesIwMCjPOaRIPH6mSotF2c%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA73QKILXWG2EHORXRR6K2DRMZCTJANCNFSM4MI7QGJQ&data=02%7C01%7Cjhalleux%40microsoft.com%7C758c6cee63274271b3a608d7e198a22f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637225917979702283&sdata=hd4weVq4%2FIKrPOvc2GAm1LCISmgSX5Yf%2BDPNh760Qos%3D&reserved=0.

darzu commented 4 years ago

Yeah, Michal and I chatted a bit and it's probably best to just show a better error for now.