Skip to content

simple eval plugin should respect extension pragmas in file #369

Closed
@codygman

Description

@codygman

Steps to reproduce

Tell us how to reproduce this issue.

Create a stack project and update Main.hs to:

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Data.ByteString.Lazy.Char8

myByteString :: ByteString
myByteString = "my "

-- >>> myByteString <> "stuff"

main :: IO ()
main = pure ()

Expected behaviour

OverloadedStrings should take effect in the inline code evaluation context resulting in:

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Data.ByteString.Lazy.Char8

myByteString :: ByteString
myByteString = "my "

-- >>> myByteString <> "stuff"
-- "my stuff"

main :: IO ()
main = pure ()

Actual behaviour

An error indicating the inline evaluation context doesn't respect OverloadedStrings. I've also verified it doesn't work with others like DeriveGeneric and TypeApplications.

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Data.ByteString.Lazy.Char8

myByteString :: ByteString
myByteString = "my "

-- >>> myByteString <> "stuff"
-- Couldn't match expected type ‘ByteString’ with actual type ‘[Char]’

main :: IO ()
main = pure ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: hls-eval-plugintype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions