Skip to content

Conversation

@TIHan
Copy link
Contributor

@TIHan TIHan commented Jun 20, 2020

  • Design
  • Implementation
    • open type on nominal types
    • open type on types with generic parameterization
    • Match resolution ambiguity behavior of opened content to how it works after a dot.
    • Cleanup some implementation details
    • Support opening unions
      • Access to union cases
      • Support generics (enclosing type instantiations)
    • Support opening records
      • Access to record labels
      • Support generics (enclosing type instantiations)
    • Combine method groups for a type's extension and intrinsic methods
    • Support opening enums
  • Tooling
    • Completions on open type
  • Tests
    • Tests on nominal types
    • Tests on types with generic parameterization
      • Simple generic types
      • Nested generic types
      • Complex types with many type parameters with nested generic types
    • Tests on nested types including ones that are generic
    • Partially convert tests to newer test framework
    • Type provider tests - Generated and Erased
    • Various uses of units of measure, either by opening the units of measure type or types annotated with units of measure
    • Add union tests
    • Add record tests
    • Add enum tests
    • Add more ambiguity tests
    • Signature file test
    • AutoOpen and assembly test
    • Re-enable completions test case on attributes

@TIHan TIHan changed the title [WIP] Open Static Classes updates [WIP] Open Type Declaration updates Jun 23, 2020
@TIHan
Copy link
Contributor Author

TIHan commented Aug 4, 2020

I'll need to do some more updates due to nameof being merged.

let y = M()
"""
|> withOptions ["--langversion:preview"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can now do withPreview :)


[<Test>]
member this.``Attributes.CanSeeOpenNamespaces.Bug268290.Case2``() =
AssertCtrlSpaceCompleteContains
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm do you know why this test case was removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I remember; I should try to enable it again.

@dsyme
Copy link
Contributor

dsyme commented Aug 10, 2020

This looks great and is ready to go in.

During the spec/code review today we spotted a couple of things which can be addressed as bug fixes after this is integrated

  • Extension methods and intrinsic methods of the same name should merge into one method set

  • I've forgotten the other tthing, @TIHan has a note :-)

@dsyme
Copy link
Contributor

dsyme commented Aug 10, 2020

@TIHan I made a note of a few other things you might like to check

  • In F# it's possible to add AutoOpen to an assembly, in which case that path is automatically opened. This feature is rarely used, and is mainly for FSHarp.Core. We should verify if it is/isn't possible to use this with open type. My belief from the code is that it is not possible. That's ok, we should just know whether it is an note it in the RFC

  • Are there tests for open type in a signature file? I believe from the code that it will work just fine.

@dsyme
Copy link
Contributor

dsyme commented Aug 10, 2020

@TIHan please resolve the xlf conflicts, thanks :-)

@TIHan
Copy link
Contributor Author

TIHan commented Aug 10, 2020

For reference, here is the final bug we need to fix: #9914

@TIHan
Copy link
Contributor Author

TIHan commented Aug 10, 2020

In F# it's possible to add AutoOpen to an assembly, in which case that path is automatically opened. This feature is rarely used, and is mainly for FSHarp.Core. We should verify if it is/isn't possible to use this with open type. My belief from the code is that it is not possible. That's ok, we should just know whether it is an note it in the RFC

Didn't know about this ability. I'll have to make a test case and see.

Are there tests for open type in a signature file? I believe from the code that it will work just fine.

No tests on signature files. We should just in case.

@TIHan
Copy link
Contributor Author

TIHan commented Aug 10, 2020

Made note of more test cases:
#9914
#9916

@TIHan TIHan merged commit f38e957 into dotnet:master Aug 11, 2020
@cartermp
Copy link
Contributor

🎉

@cartermp
Copy link
Contributor

🌮

@cartermp
Copy link
Contributor

🐔 or 🐮 ?

nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Feb 23, 2021
* Allow using nested types in unqualified scenarios

* Renaming OpenStaticClasses to OpenTypeDeclaration

* Added 'open type' declaration

* Added more tests

* Fixing build

* Added tooling support

* More updates

* Some refactor

* open static prototype

* open static prototype

* Fixes on merge

* Fixing build

* Fixing some tests

* Trying to figure out nested

* Added eUnqualifiedTyconTypeArgs

* Properly opening generic types with nested generic types

* Update test baseline

* Include range on target

* Fixing build

* Fixing build

* Fixing build

* Error if not an appty

* Slightly better error

* Getting tests to pass

* Trying to fix tests

* Get current tests to pass

* Partial working unused opens

* Almost there

* Some fixed

* Reverting back to original service analysis

* Fixed test

* Fixed test

* Fixed build

* Fixing tests

* Fixing tests

* Fixing more tests

* Removing broken tests

* Added more tests. Checking for byrefs

* More tests

* More tests

* Update tests

* Rename

* Better names

* Added test case for inherited members

* Added more tests with CSharp style extension members

* Minor format

* Minor updates

* Fixing nested types

* Fixed nested types possibly

* Trying to fix it

* Some cleanup

* More cleanup

* Partial

* Partially working

* Fixed nested types

* Fixing tests

* Removed NumStaticArgs

* Rename AddEntties/OpenEntities to AddModuleOrNamespaceRefs/OpenModuleOrNamespaceRefs

* minor cleanup

* Minor rename

* Another rename

* Update src/fsharp/symbols/Symbols.fs

Co-authored-by: Phillip Carter <pcarter@fastmail.com>

* Trying to add type provider test

* Remove type provider test for now

* Starting to convert tests

* More tests converted

* More tests converted

* more tests converted

* Added type provider tests

* Added complex generic types with nested generic types

* Added units of measure tests and named types

* Added more tests

* Added two more tests

* Added one more test

* Added enum test case

* Added enum tests and support

* Adding union case support

* Removing unions support

* Fixing build

* Disallowing operators to come into scope

* Minor refactoring

* Access to record labels and union cases

* Fixing opening generic types

* Do not need to return enclosing type instantiations from a dot

* Added generic union and record tests

* Combining intrinsic and extension method groups. Ignoring generic record/union tests.

* Update FSComp.txt.ja.xlf

* Fixing build

* Update OpenTypeDeclarationTests.fs

Co-authored-by: Don Syme <dsyme@microsoft.com>
Co-authored-by: Phillip Carter <pcarter@fastmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants