Skip to content

Commit

Permalink
Move sound problems doc out of guides/ directory (#6264)
Browse files Browse the repository at this point in the history
- Move the sound-problems doc to the deprecated directory, as most of it
is duplicated with diagnostic message docs. See
#6265 for follow up work.
- Delete the `/guides/language` index as it's not linked to from
anywhere and mostly duplicates introductions from other pages.

Contributes to #5767
Contributes to #6265
  • Loading branch information
parlough authored Dec 16, 2024
1 parent 4277161 commit 1d423d9
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 48 deletions.
7 changes: 5 additions & 2 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,12 @@
{ "source": "/googleapis", "destination": "https://github.com/dart-lang/googleapis", "type": 301 },
{ "source": "/guides/get-started", "destination": "/overview", "type": 301 },
{ "source": "/guides/google-apis", "destination": "/resources/google-apis", "type": 301 },
{ "source": "/guides/language", "destination": "/language", "type": 301 },
{ "source": "/guides/language/analysis-options", "destination": "/tools/analysis", "type": 301 },
{ "source": "/guides/language/cheatsheet", "destination": "/language", "type": 301 },
{ "source": "/guides/language/coming-from/js-to-dart", "destination": "/resources/coming-from/js-to-dart", "type": 301 },
{ "source": "/guides/language/coming-from/swift-to-dart", "destination": "/resources/coming-from/swift-to-dart", "type": 301 },
{ "source": "/guides/language/common-prob", "destination": "/guides/language/sound-problems", "type": 301 },
{ "source": "/guides/language/common-prob", "destination": "/deprecated/sound-problems", "type": 301 },
{ "source": "/guides/language/concurrency", "destination": "/language/concurrency", "type": 301 },
{ "source": "/guides/language/effective-dart", "destination": "/effective-dart", "type": 301 },
{ "source": "/guides/language/effective-dart/:page*", "destination": "/effective-dart/:page*", "type": 301 },
Expand All @@ -226,10 +227,12 @@
{ "source": "/guides/language/numbers", "destination": "/resources/language/number-representation", "type": 301 },
{ "source": "/guides/language/sound-dart", "destination": "/language/type-system", "type": 301 },
{ "source": "/guides/language/sound-faq", "destination": "/language/type-system", "type": 301 },
{ "source": "/guides/language/sound-problems", "destination": "/deprecated/sound-problems", "type": 301 },
{ "source": "/guides/language/spec", "destination": "/resources/language/spec", "type": 301 },
{ "source": "/guides/language/specifications", "destination": "/resources/language/spec", "type": 301 },
{ "source": "/guides/language/specifications/:page*", "destination": "/resources/language/spec/versions/:page*", "type": 301 },
{ "source": "/guides/language/type-system", "destination": "/language/type-system", "type": 301 },
{ "source": "/guides/language/**", "destination": "/language", "type": 301 },
{ "source": "/guides/libraries", "destination": "/libraries", "type": 301 },
{ "source": "/guides/libraries/create-library-packages", "destination": "/tools/pub/create-packages", "type": 301 },
{ "source": "/guides/libraries/create-packages", "destination": "/tools/pub/create-packages", "type": 301 },
Expand Down Expand Up @@ -263,7 +266,7 @@
{ "source": "/keyword/class", "destination": "/language/classes#instance-variables", "type": 301 },
{ "source": "/keyword/const", "destination": "/language/variables#final-and-const", "type": 301 },
{ "source": "/keyword/continue", "destination": "/language/loops#break-and-continue", "type": 301 },
{ "source": "/keyword/covariant", "destination": "/guides/language/sound-problems#the-covariant-keyword", "type": 301 },
{ "source": "/keyword/covariant", "destination": "/deprecated/sound-problems#the-covariant-keyword", "type": 301 },
{ "source": "/keyword/default", "destination": "/language/branches#switch", "type": 301 },
{ "source": "/keyword/deferred", "destination": "/language/libraries#lazily-loading-a-library", "type": 301 },
{ "source": "/keyword/do", "destination": "/language/loops#while-and-do-while", "type": 301 },
Expand Down
2 changes: 1 addition & 1 deletion src/_data/glossary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@
- text: "Covariance and contravariance"
link: "https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)"
- text: "The covariant keyword"
link: "/guides/language/sound-problems#the-covariant-keyword"
link: "/deprecated/sound-problems#the-covariant-keyword"
labels:
- "language"
- "type system"
Expand Down
2 changes: 1 addition & 1 deletion src/_data/keywords.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
link: /language/loops#break-and-continue
type: reserved
- term: 'covariant'
link: /guides/language/sound-problems#the-covariant-keyword
link: /deprecated/sound-problems#the-covariant-keyword
type: bit
- term: 'default'
link: /language/branches#switch
Expand Down
2 changes: 1 addition & 1 deletion src/_data/side-nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
- title: Customizing static analysis
permalink: /tools/analysis
- title: Fixing common type problems
permalink: /guides/language/sound-problems
permalink: /deprecated/sound-problems
- title: Fixing type promotion failures
permalink: /tools/non-promotion-reasons
- title: Linter rules
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/navigation-main.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</li>
<li class="mainnav__get-started">
<a href="/guides" class="nav-link
{%- if page_url_path contains '/*/guides/' or page_url_path contains '/*/language/' or page_url_path contains '/*/resources/' or page_url_path contains '/*/codelabs/' or page_url_path contains '/*/samples/' or page_url_path contains '/*/tools/' or page_url_path contains '/*/tutorials/' or page_url_path contains '/*/server/' or page_url_path contains '/*/web/' or page_url_path contains '/*/effective-dart/' or page_url_path contains '/*/libraries/' %} active {%- endif -%}">
{%- if page_url_path contains '/*/guides/' or page_url_path contains '/*/language/' or page_url_path contains '/*/resources/' or page_url_path contains '/*/codelabs/' or page_url_path contains '/*/deprecated/' or page_url_path contains '/*/tools/' or page_url_path contains '/*/tutorials/' or page_url_path contains '/*/server/' or page_url_path contains '/*/web/' or page_url_path contains '/*/effective-dart/' or page_url_path contains '/*/libraries/' %} active {%- endif -%}">
<span>Docs</span>
</a>
</li>
Expand Down
File renamed without changes.
37 changes: 0 additions & 37 deletions src/content/guides/language/index.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/content/language/extend.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ it's similar to a downcast in that it can cause a type error at runtime.
Still, narrowing the type is possible
if the code can guarantee that a type error won't occur.
In this case, you can use the
[`covariant` keyword](/guides/language/sound-problems#the-covariant-keyword)
[`covariant` keyword](/deprecated/sound-problems#the-covariant-keyword)
in a parameter declaration.
For details, see the
[Dart language specification][].
Expand Down
4 changes: 2 additions & 2 deletions src/content/language/type-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ subtype of the original parameter.

:::note
If you have a valid reason to use a subtype, you can use the
[`covariant` keyword](/guides/language/sound-problems#the-covariant-keyword).
[`covariant` keyword](/deprecated/sound-problems#the-covariant-keyword).
:::

Consider the `chase(Animal)` method for the `Animal` class:
Expand Down Expand Up @@ -488,7 +488,7 @@ and [Use sound parameter types when overriding methods](#use-proper-param-types)

The following resources have further information on sound Dart:

* [Fixing common type problems](/guides/language/sound-problems) -
* [Fixing common type problems](/deprecated/sound-problems) -
Errors you may encounter when writing sound Dart code, and how to fix them.
* [Fixing type promotion failures](/tools/non-promotion-reasons) -
Understand and learn how to fix type promotion errors.
Expand Down
2 changes: 1 addition & 1 deletion src/content/resources/coming-from/js-to-dart.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ consider themselves as equal.
:::

[Built-in types]: /language/built-in-types
[Dart Language Tour]: /guides/language
[Dart Language Tour]: /language

For example:
The equals operator `==` and the `identical()` method return `true`
Expand Down
2 changes: 1 addition & 1 deletion src/content/resources/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ we made the following changes to this site:
* Added a section on customizing [`dart fix`][].

[Objective-C and Swift interop]: /interop/objective-c-interop
[Fixing common type problems]: /guides/language/sound-problems
[Fixing common type problems]: /deprecated/sound-problems
[What not to commit]: /tools/pub/private-files
[`dart pub get` Options]: /tools/pub/cmd/pub-get#options
[`dart compile`]: /tools/dart-compile
Expand Down

0 comments on commit 1d423d9

Please sign in to comment.