{"id":23879355,"url":"https://github.com/ceedubs/alias-companion-weirdness","last_synced_at":"2026-06-19T13:32:46.034Z","repository":{"id":31656304,"uuid":"35221652","full_name":"ceedubs/alias-companion-weirdness","owner":"ceedubs","description":"This project demonstrates a weird Scala bug with type aliases and companion objects","archived":false,"fork":false,"pushed_at":"2015-05-07T13:36:52.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T23:26:52.194Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ceedubs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-07T13:29:13.000Z","updated_at":"2015-05-07T13:36:53.000Z","dependencies_parsed_at":"2022-09-10T07:01:50.927Z","dependency_job_id":null,"html_url":"https://github.com/ceedubs/alias-companion-weirdness","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ceedubs/alias-companion-weirdness","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceedubs%2Falias-companion-weirdness","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceedubs%2Falias-companion-weirdness/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceedubs%2Falias-companion-weirdness/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceedubs%2Falias-companion-weirdness/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceedubs","download_url":"https://codeload.github.com/ceedubs/alias-companion-weirdness/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceedubs%2Falias-companion-weirdness/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34534274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-03T22:51:56.967Z","updated_at":"2026-06-19T13:32:46.009Z","avatar_url":"https://github.com/ceedubs.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weirdness\n\nThis project demonstrates a weird Scala bug.\n\nOops, as it turns out, this is already filed as [SI-7139](https://issues.scala-lang.org/browse/SI-7139).\n\n## What's here\n\nThe `foo` package object declares two type aliases:\n\n```scala\npackage ceedubs\n\npackage object foo {\n  type Id[A] = A\n  type Foo[A] = FooT[Id, A]\n}\n```\n\n`FooT[F[_], A]` simply wraps an `F[A]`:\n\n```scala\npackage ceedubs\npackage foo\n\nclass FooT[F[_], A](fa: F[A])\n\nobject Foo {\n  def apply[A](a: A): Foo[A] = new FooT[Id, A](a)\n}\n```\n\nNothing particularly exciting.\n\n## To the REPL\n\nIt works in the REPL just like you would expect:\n\n```scala\nscala\u003e import ceedubs.foo.Foo\nimport ceedubs.foo.Foo\n\nscala\u003e val f1: Foo[Int] = Foo(1)\nf1: ceedubs.foo.Foo[Int] = ceedubs.foo.FooT@7df35060\n```\n\n**Until** you try to use it a second time (note that the only change is the name of the `val`):\n\n```scala\nscala\u003e val f2: Foo[Int] = Foo(1)\n\u003cconsole\u003e:8: error: ceedubs.foo.Foo.type does not take parameters\n       val f2: Foo[Int] = Foo(1)\n```\n\nWhat's going on here?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceedubs%2Falias-companion-weirdness","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceedubs%2Falias-companion-weirdness","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceedubs%2Falias-companion-weirdness/lists"}