{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/apireviews/pulls/comments/43203223","id":43203223,"diff_hunk":"@@ -0,0 +1,168 @@\n+```diff\n+---\\\\cpvsbuild\\drops\\Roslyn\\Roslyn-Master-Signed-Release\\20151026.22\n+   namespace Microsoft.CodeAnalysis.CSharp.Scripting {\n+  public static class CSharpScript {\n+    public static Script<object> Create(string code, ScriptOptions options=null, Type globalsType=null, InteractiveAssemblyLoader assemblyLoader=null);\n+    public static Script<T> Create<T>(string code, ScriptOptions options=null, Type globalsType=null, InteractiveAssemblyLoader assemblyLoader=null);\n+    public static Task<object> EvaluateAsync(string code, ScriptOptions options=null, object globals=null, Type globalsType=null, CancellationToken cancellationToken=null);\n+    public static Task<T> EvaluateAsync<T>(string code, ScriptOptions options=null, object globals=null, Type globalsType=null, CancellationToken cancellationToken=null);\n+    public static Task<ScriptState<object>> RunAsync(string code, ScriptOptions options=null, object globals=null, Type globalsType=null, CancellationToken cancellationToken=null);\n+    public static Task<ScriptState<T>> RunAsync<T>(string code, ScriptOptions options=null, object globals=null, Type globalsType=null, CancellationToken cancellationToken=null);\n+  }\n+ }\n+ namespace Microsoft.CodeAnalysis.CSharp.Scripting.Hosting {\n+  public sealed class CSharpObjectFormatter : ObjectFormatter {\n+    public static CSharpObjectFormatter Instance { get; }\n+  }\n+ }\n+ namespace Microsoft.CodeAnalysis.Scripting {\n+  public sealed class CompilationErrorException : Exception {\n+    ^ Immo Landwerth: Should have public .ctors\n+    public ImmutableArray<Diagnostic> Diagnostics { get; }\n+  }\n+  public abstract class Script {\n+    public string Code { get; }\n+    public Type GlobalsType { get; }\n+    public ScriptOptions Options { get; }\n+    public Script Previous { get; }\n+    public abstract Type ReturnType { get; }\n+    public ImmutableArray<Diagnostic> Build(CancellationToken cancellationToken=null);\n+    ^ Immo Landwerth: Should be called Compile\n+    public Script<object> ContinueWith(string code, ScriptOptions options=null);\n+    public Script<TResult> ContinueWith<TResult>(string code, ScriptOptions options=null);\n+    public Compilation GetCompilation();\n+    public Task<ScriptState> RunAsync(object globals=null, CancellationToken cancellationToken=null);\n+    public Script WithCode(string code);\n+    ^ Immo Landwerth: Remove. Confusion with ContinueWith.\n+    public Script WithGlobalsType(Type globalsType);\n+    ^ Immo Landwerth: Remove. Unclear what the chaining semantics are.\n+    public Script WithOptions(ScriptOptions options);\n+  }\n+  public sealed class Script<T> : Script {\n+    public override Type ReturnType { get; }\n+    public ScriptRunner<T> CreateDelegate(CancellationToken cancellationToken=null);\n+    public new Task<ScriptState<T>> RunAsync(object globals=null, CancellationToken cancellationToken=null);\n+    public new Script<T> WithCode(string code);\n+    ^ Immo Landwerth: Same\n+    public new Script<T> WithGlobalsType(Type globalsType);\n+    ^ Immo Landwerth: Same\n+    public new Script<T> WithOptions(ScriptOptions options);\n+  }\n+  public sealed class ScriptMetadataResolver : MetadataReferenceResolver, IEquatable<ScriptMetadataResolver> {\n+    public string BaseDirectory { get; }\n+    public static ScriptMetadataResolver Default { get; }\n+    public override bool ResolveMissingAssemblies { get; }\n+    public ImmutableArray<string> SearchPaths { get; }\n+    public bool Equals(ScriptMetadataResolver other);\n+    public override bool Equals(object other);\n+    public override int GetHashCode();\n+    public override PortableExecutableReference ResolveMissingAssembly(MetadataReference definition, AssemblyIdentity referenceIdentity);\n+    public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties);\n+    public ScriptMetadataResolver WithBaseDirectory(string baseDirectory);\n+    public ScriptMetadataResolver WithSearchPaths(IEnumerable<string> searchPaths);\n+    public ScriptMetadataResolver WithSearchPaths(ImmutableArray<string> searchPaths);\n+    public ScriptMetadataResolver WithSearchPaths(params string[] searchPaths);\n+  }\n+  public sealed class ScriptOptions {\n+    public static readonly ScriptOptions Default;\n+    ^ Immo Landwerth: Make a property\n+    public string FilePath { get; }\n+    public ImmutableArray<string> Imports { get; }\n+    public ImmutableArray<MetadataReference> MetadataReferences { get; }\n+    public MetadataReferenceResolver MetadataResolver { get; }\n+    public SourceReferenceResolver SourceResolver { get; }\n+    public ScriptOptions AddImports(IEnumerable<string> imports);\n+    public ScriptOptions AddImports(params string[] imports);\n+    public ScriptOptions AddReferences(params MetadataReference[] references);\n+    public ScriptOptions AddReferences(IEnumerable<MetadataReference> references);\n+    public ScriptOptions AddReferences(IEnumerable<Assembly> references);\n+    public ScriptOptions AddReferences(IEnumerable<string> references);\n+    public ScriptOptions AddReferences(params Assembly[] references);\n+    public ScriptOptions AddReferences(params string[] references);\n+    public ScriptOptions WithFilePath(string filePath);\n+    public ScriptOptions WithImports(IEnumerable<string> imports);\n+    public ScriptOptions WithImports(params string[] imports);\n+    public ScriptOptions WithMetadataResolver(MetadataReferenceResolver resolver);\n+    public ScriptOptions WithReferences(params MetadataReference[] references);\n+    public ScriptOptions WithReferences(IEnumerable<MetadataReference> references);\n+    public ScriptOptions WithReferences(IEnumerable<Assembly> references);\n+    public ScriptOptions WithReferences(IEnumerable<string> references);\n+    public ScriptOptions WithReferences(params Assembly[] references);\n+    public ScriptOptions WithReferences(params string[] references);\n+    public ScriptOptions WithSourceResolver(SourceReferenceResolver resolver);\n+  }\n+  public delegate Task<T> ScriptRunner<T>(object globals=null, CancellationToken cancellationToken=null);\n+  public sealed class ScriptSourceResolver : SourceFileResolver, IEquatable<ScriptSourceResolver> {\n+    ^ Immo Landwerth: You should consider having == because IEquatable<>. Perhaps you want to offload Equals into a separate comparer.","path":"2015-10-27-csharp-interactive/APIs.md","position":96,"original_position":96,"commit_id":"de28e537fe760ed05f5e1d964229aff6412e18d2","original_commit_id":"de28e537fe760ed05f5e1d964229aff6412e18d2","user":{"login":"tmat","id":41759,"avatar_url":"https://avatars.githubusercontent.com/u/41759?v=3","gravatar_id":"","url":"https://api.github.com/users/tmat","html_url":"https://github.com/tmat","followers_url":"https://api.github.com/users/tmat/followers","following_url":"https://api.github.com/users/tmat/following{/other_user}","gists_url":"https://api.github.com/users/tmat/gists{/gist_id}","starred_url":"https://api.github.com/users/tmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmat/subscriptions","organizations_url":"https://api.github.com/users/tmat/orgs","repos_url":"https://api.github.com/users/tmat/repos","events_url":"https://api.github.com/users/tmat/events{/privacy}","received_events_url":"https://api.github.com/users/tmat/received_events","type":"User","site_admin":false},"body":"The scenario where equality is needed is when CompilationOptions are compared (CSharp and VB compilation options implement IEquatable). CompilationOtpions have SourceReferenceResolver and MetadataReferenceResolver fields and CompilationOptions.Equals calls Equals on these resolvers. ScriptSourceResolver derives from SourceReferenceResolver and overrides Equals. \r\n\r\nNone of the existing (already shipped) classes implement operators == and !=. So I'm going to keep it consistent for now.","created_at":"2015-10-27T23:40:29Z","updated_at":"2015-10-27T23:40:29Z","html_url":"https://github.com/dotnet/apireviews/pull/18#discussion_r43203223","pull_request_url":"https://api.github.com/repos/dotnet/apireviews/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/dotnet/apireviews/pulls/comments/43203223"},"html":{"href":"https://github.com/dotnet/apireviews/pull/18#discussion_r43203223"},"pull_request":{"href":"https://api.github.com/repos/dotnet/apireviews/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/apireviews/pulls/18","id":48943667,"html_url":"https://github.com/dotnet/apireviews/pull/18","diff_url":"https://github.com/dotnet/apireviews/pull/18.diff","patch_url":"https://github.com/dotnet/apireviews/pull/18.patch","issue_url":"https://api.github.com/repos/dotnet/apireviews/issues/18","number":18,"state":"open","locked":false,"title":"Add 2015-10-27-csharp-interactive","user":{"login":"terrajobst","id":5169960,"avatar_url":"https://avatars.githubusercontent.com/u/5169960?v=3","gravatar_id":"","url":"https://api.github.com/users/terrajobst","html_url":"https://github.com/terrajobst","followers_url":"https://api.github.com/users/terrajobst/followers","following_url":"https://api.github.com/users/terrajobst/following{/other_user}","gists_url":"https://api.github.com/users/terrajobst/gists{/gist_id}","starred_url":"https://api.github.com/users/terrajobst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terrajobst/subscriptions","organizations_url":"https://api.github.com/users/terrajobst/orgs","repos_url":"https://api.github.com/users/terrajobst/repos","events_url":"https://api.github.com/users/terrajobst/events{/privacy}","received_events_url":"https://api.github.com/users/terrajobst/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-27T22:49:26Z","updated_at":"2015-10-27T23:40:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38bbb1e688058da817536f07d8c6765e3ec66962","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/apireviews/pulls/18/commits","review_comments_url":"https://api.github.com/repos/dotnet/apireviews/pulls/18/comments","review_comment_url":"https://api.github.com/repos/dotnet/apireviews/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/apireviews/issues/18/comments","statuses_url":"https://api.github.com/repos/dotnet/apireviews/statuses/de28e537fe760ed05f5e1d964229aff6412e18d2","head":{"label":"dotnet:2015-10-27-csharp-interactive","ref":"2015-10-27-csharp-interactive","sha":"de28e537fe760ed05f5e1d964229aff6412e18d2","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":28941958,"name":"apireviews","full_name":"dotnet/apireviews","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/apireviews","description":"This repository contains the notes and API differences that we reviewed.","fork":false,"url":"https://api.github.com/repos/dotnet/apireviews","forks_url":"https://api.github.com/repos/dotnet/apireviews/forks","keys_url":"https://api.github.com/repos/dotnet/apireviews/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/apireviews/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/apireviews/teams","hooks_url":"https://api.github.com/repos/dotnet/apireviews/hooks","issue_events_url":"https://api.github.com/repos/dotnet/apireviews/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/apireviews/events","assignees_url":"https://api.github.com/repos/dotnet/apireviews/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/apireviews/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/apireviews/tags","blobs_url":"https://api.github.com/repos/dotnet/apireviews/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/apireviews/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/apireviews/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/apireviews/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/apireviews/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/apireviews/languages","stargazers_url":"https://api.github.com/repos/dotnet/apireviews/stargazers","contributors_url":"https://api.github.com/repos/dotnet/apireviews/contributors","subscribers_url":"https://api.github.com/repos/dotnet/apireviews/subscribers","subscription_url":"https://api.github.com/repos/dotnet/apireviews/subscription","commits_url":"https://api.github.com/repos/dotnet/apireviews/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/apireviews/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/apireviews/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/apireviews/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/apireviews/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/apireviews/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/apireviews/merges","archive_url":"https://api.github.com/repos/dotnet/apireviews/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/apireviews/downloads","issues_url":"https://api.github.com/repos/dotnet/apireviews/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/apireviews/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/apireviews/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/apireviews/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/apireviews/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/apireviews/releases{/id}","created_at":"2015-01-08T01:02:57Z","updated_at":"2015-10-12T22:27:21Z","pushed_at":"2015-10-27T22:51:07Z","git_url":"git://github.com/dotnet/apireviews.git","ssh_url":"git@github.com:dotnet/apireviews.git","clone_url":"https://github.com/dotnet/apireviews.git","svn_url":"https://github.com/dotnet/apireviews","homepage":"","size":504,"stargazers_count":57,"watchers_count":57,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":1,"forks":8,"open_issues":1,"watchers":57,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"91680bfd01ff4408a2a41f99f3b3114a79603f91","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":28941958,"name":"apireviews","full_name":"dotnet/apireviews","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/apireviews","description":"This repository contains the notes and API differences that we reviewed.","fork":false,"url":"https://api.github.com/repos/dotnet/apireviews","forks_url":"https://api.github.com/repos/dotnet/apireviews/forks","keys_url":"https://api.github.com/repos/dotnet/apireviews/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/apireviews/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/apireviews/teams","hooks_url":"https://api.github.com/repos/dotnet/apireviews/hooks","issue_events_url":"https://api.github.com/repos/dotnet/apireviews/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/apireviews/events","assignees_url":"https://api.github.com/repos/dotnet/apireviews/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/apireviews/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/apireviews/tags","blobs_url":"https://api.github.com/repos/dotnet/apireviews/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/apireviews/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/apireviews/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/apireviews/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/apireviews/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/apireviews/languages","stargazers_url":"https://api.github.com/repos/dotnet/apireviews/stargazers","contributors_url":"https://api.github.com/repos/dotnet/apireviews/contributors","subscribers_url":"https://api.github.com/repos/dotnet/apireviews/subscribers","subscription_url":"https://api.github.com/repos/dotnet/apireviews/subscription","commits_url":"https://api.github.com/repos/dotnet/apireviews/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/apireviews/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/apireviews/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/apireviews/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/apireviews/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/apireviews/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/apireviews/merges","archive_url":"https://api.github.com/repos/dotnet/apireviews/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/apireviews/downloads","issues_url":"https://api.github.com/repos/dotnet/apireviews/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/apireviews/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/apireviews/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/apireviews/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/apireviews/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/apireviews/releases{/id}","created_at":"2015-01-08T01:02:57Z","updated_at":"2015-10-12T22:27:21Z","pushed_at":"2015-10-27T22:51:07Z","git_url":"git://github.com/dotnet/apireviews.git","ssh_url":"git@github.com:dotnet/apireviews.git","clone_url":"https://github.com/dotnet/apireviews.git","svn_url":"https://github.com/dotnet/apireviews","homepage":"","size":504,"stargazers_count":57,"watchers_count":57,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":1,"forks":8,"open_issues":1,"watchers":57,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/apireviews/pulls/18"},"html":{"href":"https://github.com/dotnet/apireviews/pull/18"},"issue":{"href":"https://api.github.com/repos/dotnet/apireviews/issues/18"},"comments":{"href":"https://api.github.com/repos/dotnet/apireviews/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/apireviews/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/apireviews/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/apireviews/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/apireviews/statuses/de28e537fe760ed05f5e1d964229aff6412e18d2"}}}}