microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
738 stars 243 forks source link

Exposed "protected" variables renders page non-extensible #6637

Open hemisphera opened 3 years ago

hemisphera commented 3 years ago

1. Describe the bug Any protected variables on a page that are of a type that is not included as dependency in the extending app causes the extending app to fail deployment.

2. To Reproduce

3. Expected behavior I am not sure how the app should behave. It's obvious that the variable that is exposed requires me to also have a dependency on "Library", but on the other hand: I cannot know what are all the apps that "Master" depends on.

4. Actual behavior Deployment fails with the following message:

The request […] failed with code UnprocessableEntity. Reason: One or more errors occurred.
Failure while emitting object. Object:'PageExtension "ZhePageExt"'
This program location is thought to be unreachable. None

5. Versions:

dzzzb commented 3 years ago

The error suggests MS weren't sure how the app should behave either ;-)

To MS: Is it possible this could not be an error, unless we actually use the protected field? As said, we shouldn't have to somehow track and depend on everything the base object does. Ideally, IMO, we'd only need to depend on the app providing the protected field type, if we actually try to reference/use it in our app. I don't know whether that's feasible, though...

atoader commented 3 years ago

Can you provide a project that reproduces this instead of instructions on how to reproduce? It helps avoid time wasted wondering if the repro is the correct one.

hemisphera commented 3 years ago

Hi Alex,

here you go: https://1drv.ms/u/s!Av1ddPEVOtoEguU8CldRTm7U5SA3hA?e=KPySvj

This is a .ZIP containing the 3 apps. Just follow these steps:

  1. Build & Publish Library
  2. Build & Publish Main
  3. Build & Publish Dependant